Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incomplete computed property deoptimization (#3267)
- Loading branch information
1 parent
d7e3993
commit d5651be
Showing
4 changed files
with
41 additions
and
2 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
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,3 @@ | ||
module.exports = { | ||
description: 'deoptimizes cached properties and return values if necessary (#3264)' | ||
}; |
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,24 @@ | ||
const obj1 = {}; | ||
let prop = 'x'; | ||
|
||
updateProp(); | ||
|
||
obj1[prop] = true; | ||
|
||
assert.strictEqual(obj1.y ? 'WORKING' : 'BUG', 'WORKING'); | ||
|
||
function updateProp() { | ||
prop = 'y'; | ||
} | ||
|
||
const obj2 = {}; | ||
obj2[getResult().prop] = 1; | ||
|
||
assert.equal(obj2.foo ? 'WORKING' : 'BUG', 'WORKING'); | ||
|
||
function getResult() { | ||
const result = {}; | ||
result.prop = 'foo'; | ||
return result; | ||
} | ||
|