-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deoptimize ObjectExpression when a __proto__ property is present (#4019)
* Deoptimize ObjectExpression when a __proto__ property is present Closes #4014 * Integrate __proto__ detection with getPropertyMap * Fix formatting Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com> Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
- Loading branch information
1 parent
56b3eb8
commit 85a3724
Showing
4 changed files
with
45 additions
and
9 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
3 changes: 3 additions & 0 deletions
3
test/form/samples/object-expression/proto-property/_config.js
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: 'Deoptimize when __proto__ is used' | ||
}; |
13 changes: 13 additions & 0 deletions
13
test/form/samples/object-expression/proto-property/_expected.js
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 @@ | ||
let proto = { | ||
get a() { log(); } | ||
}; | ||
|
||
let plainProto = { | ||
__proto__: proto | ||
}; | ||
if (plainProto.a) log("plainProto"); | ||
|
||
let quotedProto = { | ||
"__proto__": proto | ||
}; | ||
if (quotedProto.a) log("quotedProto"); |
18 changes: 18 additions & 0 deletions
18
test/form/samples/object-expression/proto-property/main.js
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,18 @@ | ||
let basic = { | ||
a: false | ||
}; | ||
if (basic.a) log("basic"); | ||
|
||
let proto = { | ||
get a() { log(); } | ||
}; | ||
|
||
let plainProto = { | ||
__proto__: proto | ||
}; | ||
if (plainProto.a) log("plainProto"); | ||
|
||
let quotedProto = { | ||
"__proto__": proto | ||
}; | ||
if (quotedProto.a) log("quotedProto"); |