tc39 / ecmascript_simd

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

Coerce lane indexes with ToNumber(). #335

Open stoklund opened 8 years ago

stoklund commented 8 years ago

SIMD functions that take a lane index (extractLane, replaceLane, swizzle, shuffle) should use ToNumber() to coerce the lane index to a number before checking that the index is an integer in range.

This behavior corresponds to the SIMDToLane() function in the SIMD.js specification.

This fixes issues #319 and #237.

PeterJensen commented 8 years ago

I think you meant #329 instead of 319, right?

stoklund commented 8 years ago

Oops, you are right. Fixed.

stoklund commented 8 years ago

Thanks, Peter. I found another mistake in the validLaneIndex() function.