Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1135718 - Convert unboxed plain objects to natives before changin…
…g their prototype, r=jandem.
- Loading branch information
Showing
2 changed files
with
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
setJitCompilerOption("ion.warmup.trigger", 30); | ||
function ArrayCallback(state) | ||
this.state = state; | ||
ArrayCallback.prototype.isUpperCase = function(v, index, array) { | ||
return this.state ? true : (v == v.toUpperCase()); | ||
}; | ||
strings = ['hello', 'Array', 'WORLD']; | ||
obj = new ArrayCallback(false); | ||
strings.filter(obj.isUpperCase, obj) | ||
obj = new ArrayCallback(true); | ||
strings.filter(obj.isUpperCase, obj) | ||
obj.__proto__ = {}; |
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