This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't generate redundant calls to query captured scopes
Release notes: None Don't generate redundant calls of the form `var __captured__scope_2 = __scope_0[0] || __scope_1(0);` Adding regression test. This addresses one of the observations of #1732. Also deleted unneeded left-over code and comment that used to refer #989.
- Loading branch information
Showing
2 changed files
with
20 additions
and
5 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
16 changes: 16 additions & 0 deletions
16
test/serializer/additional-functions/ModifiedBindingsCapturedScopesCalls.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,16 @@ | ||
// add at runtime:var a = 17; | ||
// Copies of \|\|:2 | ||
(function () { | ||
let a, b, c, d; | ||
global.f = function() { | ||
a = 1; | ||
b = 2; | ||
c = 3; | ||
d = 4; | ||
} | ||
if (global.__optimize) __optimize(f); | ||
inspect = function() { | ||
global.f(); | ||
return a + b + c + d; | ||
} | ||
})(); |