summaryrefslogtreecommitdiff
path: root/js/src/builtin/Utilities.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-03-27 13:22:30 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-03-27 13:22:30 +0200
commit8d5ec757ece850fb7ad5c712868f305636e41177 (patch)
tree92acdb7783ab29bdfa2837ad54afa491c2c42867 /js/src/builtin/Utilities.js
parente19749682050ff716fc9ff3bbc05ee3911570670 (diff)
parent5fd5b2ac2f396eb1d8707a691aa26ad159ad25e3 (diff)
downloaduxp-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.js12
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);
}