tc39 / ecmascript_simd

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

SIMD wrapper object prototypes should implement @@toPrimitive #223

Closed ajklein closed 9 years ago

ajklein commented 9 years ago

This is observable, for example, in:

SIMD.Float32x4() == Object(SIMD.Float32x4())  // should be true
littledan commented 9 years ago

Fixed in the spec. I don't think we need to bother fixing this in the polyfill since browsers don't implement @@toPrimitive yet.

ljharb commented 9 years ago

I do think it would still be worthwhile to have the polyfill do if (typeof Symbol === 'function' && typeof Symbol.toPrimitive === 'symbol') and add the mechanism, even if there's no browsers that implement it yet.

It's likely there will be browsers implementing it before SIMD.

littledan commented 9 years ago

Sure, we could do that. I'd be glad to review a pull request implementing that.