Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support implicit type coercion errors in es5-shim
- Loading branch information
1 parent
3ff3db8
commit 1d4d93d
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
description: | ||
'deoptimize concatenation when used as an expression statement to better support es5-shim' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function parseInt(str, radix) { | ||
if (typeof str === 'symbol') { | ||
'' + str; | ||
} | ||
|
||
var string = trim(String(str)); | ||
var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); | ||
return origParseInt(string, defaultedRadix); | ||
} | ||
|
||
console.log(parseInt('1')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function parseInt(str, radix) { | ||
if (typeof str === 'symbol') { | ||
'' + str; | ||
} | ||
|
||
var string = trim(String(str)); | ||
var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); | ||
return origParseInt(string, defaultedRadix); | ||
} | ||
|
||
console.log(parseInt('1')); |