diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-27 13:22:30 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-27 13:22:30 +0200 |
commit | 8d5ec757ece850fb7ad5c712868f305636e41177 (patch) | |
tree | 92acdb7783ab29bdfa2837ad54afa491c2c42867 /js/src/builtin/Utilities.js | |
parent | e19749682050ff716fc9ff3bbc05ee3911570670 (diff) | |
parent | 5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3 (diff) | |
download | uxp-8d5ec757ece850fb7ad5c712868f305636e41177.tar.gz |
Merge remote-tracking branch 'janek/js_regexp_lastindex_1'
Diffstat (limited to 'js/src/builtin/Utilities.js')
-rw-r--r-- | js/src/builtin/Utilities.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/js/src/builtin/Utilities.js b/js/src/builtin/Utilities.js index bfb1fe7f45..c73bc5e7f7 100644 --- a/js/src/builtin/Utilities.js +++ b/js/src/builtin/Utilities.js @@ -106,7 +106,17 @@ function ToLength(v) { return std_Math_min(v, 0x1fffffffffffff); } -/* Spec: ECMAScript Draft, 6th edition Oct 14, 2014, 7.2.4 */ +// ES2017 draft rev aebf014403a3e641fb1622aec47c40f051943527 +// 7.2.9 SameValue ( x, y ) +function SameValue(x, y) { + if (x === y) { + return (x !== 0) || (1 / x === 1 / y); + } + return (x !== x && y !== y); +} + +// ES2017 draft rev aebf014403a3e641fb1622aec47c40f051943527 +// 7.2.10 SameValueZero ( x, y ) function SameValueZero(x, y) { return x === y || (x !== x && y !== y); } |