aswi2020vldc-gitlab/templetes/node_modules/es-abstract/2017/StrictEqualityComparison.js @ 56f6c6df
1 |
'use strict'; |
---|---|
2 |
|
3 |
var Type = require('./Type'); |
4 |
|
5 |
// https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6
|
6 |
|
7 |
module.exports = function StrictEqualityComparison(x, y) { |
8 |
var xType = Type(x); |
9 |
var yType = Type(y); |
10 |
if (xType !== yType) { |
11 |
return false; |
12 |
}
|
13 |
if (xType === 'Undefined' || xType === 'Null') { |
14 |
return true; |
15 |
}
|
16 |
return x === y; // shortcut for steps 4-7 |
17 |
};
|