diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-24 16:01:06 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-24 16:01:06 +0100 |
commit | 5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3 (patch) | |
tree | 5818ef1493eb4531162f5dc6e193f5227caf9049 /js/src/builtin/Utilities.js | |
parent | aae3a117342e8959c074ea9f36cefac772f608d3 (diff) | |
download | UXP-5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3.tar UXP-5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3.tar.gz UXP-5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3.tar.lz UXP-5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3.tar.xz UXP-5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3.zip |
Bug 1317397: Only set lastIndex for global or sticky RegExps in RegExpBuiltinExec per ES2017
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 2dece3801..3145b4d51 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); } |