Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 761 Bytes

JavaScript-target-versions.md

File metadata and controls

21 lines (13 loc) · 761 Bytes

BuckleScript targets ES5.

Below is a list of polyfills from ES6 needed:

Math.imul

This polyfill is needed for int32 multiplication. The polyfill is actually implemented in the generated code.

No action is required by the user.

TypedArray

The following functions require the TypedArray polyfill:

  • Int64.float_of_bits
  • Int64.bits_of_float
  • Int32.float_of_bits
  • Int32.bits_of_float

The TypedArray polyfill is not provided by BuckleScript and it's the responsibility of the user to bundle the desired polyfill implementation with the BuckleScript generated code.

For the current BuckleScript version, if the user does not bundle the TypedArray polyfill and the JavaScript engine does not support it, the code will fail at runtime.