diff options
Diffstat (limited to 'js/vendor/es6-shim/README.md')
-rw-r--r-- | js/vendor/es6-shim/README.md | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/js/vendor/es6-shim/README.md b/js/vendor/es6-shim/README.md index 074dd5af2..9e1b54169 100644 --- a/js/vendor/es6-shim/README.md +++ b/js/vendor/es6-shim/README.md @@ -44,6 +44,7 @@ In both browser and node you may also want to include `unorm`; see the [`String. * `RegExp.prototype`: * `flags` (requires ES5) ([a standalone shim is also available](https://github.com/es-shims/RegExp.prototype.flags)) * `Number`: + * binary and octal literals: `Number('0b1')` and `Number('0o7')` * `EPSILON` * `MAX_SAFE_INTEGER` * `MIN_SAFE_INTEGER` @@ -213,8 +214,14 @@ Promise.resolve(5).then(function (value) { ## Caveats -- `Object.setPrototypeOf` / `Reflect.setPrototypeOf` + - `Object.setPrototypeOf` / `Reflect.setPrototypeOf` - Note that null objects (`Object.create(null)`, eg, an object with `null` as its `[[Prototype]]`) can not have their `[[Prototype]]` changed except via a native `Object.setPrototypeOf`. + - `Number`: + - In order to support binary literals (`Number('0b1')`) and octal literals (`Number('0o7')`), the global `Number` constructor is wrapped in a shim. However, this can cause issues in the exceedingly unlikely event that you ever call `Number` as a function with a receiver (a “this” value) that is itself a number. Some problematic examples: +```js + assert(typeof Number.call(2, 3) === 'number'); // will fail when `Number` is wrapped, is "object" + assert(typeof (1).constructor(2) === 'number'); // will fail when `Number` is wrapped, is "object" +``` ## [License][license-url] |