Skip to content

Commit

Permalink
[Fix] SameValue: Use Object.is(…) if available
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss authored and ljharb committed Jun 7, 2020
1 parent 89916cc commit 8735417
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion 2015/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 2016/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 2017/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 2018/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 2019/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 2020/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 2021/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 2022/SameValue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion 5/SameValue.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

var GetIntrinsic = require('../GetIntrinsic');
var $isNaN = require('../helpers/isNaN');

// http://262.ecma-international.org/5.1/#sec-9.12

module.exports = function SameValue(x, y) {
module.exports = GetIntrinsic('%Object.is%', true) || function SameValue(x, y) {
if (x === y) { // 0 === -0, but they are not identical.
if (x === 0) { return 1 / x === 1 / y; }
return true;
Expand Down

0 comments on commit 8735417

Please sign in to comment.