tc39 / ecmascript_simd

SIMD numeric type for EcmaScript
Other
543 stars 64 forks source link

Polyfill simdCheckLaneIndex requires Int32 values, spec applies ToNumber first #329

Open stoklund opened 8 years ago

stoklund commented 8 years ago

The API function arguments that represent lane indexes are checked with the simdCheckLaneIndex() in the polyfill. This function throws a TypeError if the argument is not an Int32 Number.

The spec uses the abstract function SIMDToLane which first applies ToNumber before checking that the argument is an integer in the right range. This function only throws a TypeError when ToNumber throws.

Some differences:

stoklund commented 8 years ago

Is this the same as #237?

nmostafa commented 8 years ago

Revisited here too: 308 The polyfill should be fixed to follow the spec.

stoklund commented 8 years ago

I agree. The spec is fine, we should just fix the polyfill and tests.