google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.17k stars 581 forks source link

Typed objects polyfill #935

Open DmT021 opened 10 years ago

DmT021 commented 10 years ago

Do we need polyfill for typed objects, e.g. StructType, typed arrays, etc?

dwoldrich commented 9 years ago

Yes, please, I would do it myself if I knew how!

But rather than polyfilling, how about transpiling StructType to ArrayBuffer/TypedArrays, assuming those features are either native to the browser or have themselves been polyfilled?

Can StructType be transpiled efficiently, though? Is the correct approach to maintain shadow Typed Arrays that index into the backing ArrayBuffer store?

It seems like a limitation would be operators === and !== could not be implemented for a transpiled StructType?