Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es-abstract/2018/StrictEqualityComparison.js')
-rw-r--r--node_modules/es-abstract/2018/StrictEqualityComparison.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/node_modules/es-abstract/2018/StrictEqualityComparison.js b/node_modules/es-abstract/2018/StrictEqualityComparison.js
new file mode 100644
index 000000000..eea5df388
--- /dev/null
+++ b/node_modules/es-abstract/2018/StrictEqualityComparison.js
@@ -0,0 +1,17 @@
+'use strict';
+
+var Type = require('./Type');
+
+// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6
+
+module.exports = function StrictEqualityComparison(x, y) {
+ var xType = Type(x);
+ var yType = Type(y);
+ if (xType !== yType) {
+ return false;
+ }
+ if (xType === 'Undefined' || xType === 'Null') {
+ return true;
+ }
+ return x === y; // shortcut for steps 4-7
+};