File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed
src/com/google/javascript/jscomp
test/com/google/javascript/jscomp/integration Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -188,30 +188,14 @@ public static void addRewritePolyfillPass(List<PassFactory> passes) {
188
188
private static final PassFactory rewriteAsyncFunctions =
189
189
PassFactory .builder ()
190
190
.setName ("rewriteAsyncFunctions" )
191
- .setInternalFactory (
192
- (compiler ) ->
193
- new RewriteAsyncFunctions .Builder (compiler )
194
- // If ES2015 classes will not be transpiled away later,
195
- // transpile away property references that use `super` in async functions.
196
- // See explanation in RewriteAsyncFunctions.
197
- .rewriteSuperPropertyReferencesWithoutSuper (
198
- !compiler .getOptions ().needsTranspilationFrom (FeatureSet .ES2015 ))
199
- .build ())
191
+ .setInternalFactory ((compiler ) -> new RewriteAsyncFunctions .Builder (compiler ).build ())
200
192
.setFeatureSetForChecks ()
201
193
.build ();
202
194
203
195
private static final PassFactory rewriteAsyncIteration =
204
196
PassFactory .builder ()
205
197
.setName ("rewriteAsyncIteration" )
206
- .setInternalFactory (
207
- (compiler ) ->
208
- new RewriteAsyncIteration .Builder (compiler )
209
- // If ES2015 classes will not be transpiled away later,
210
- // transpile away property references that use `super` in async iteration.
211
- // See explanation in RewriteAsyncIteration.
212
- .rewriteSuperPropertyReferencesWithoutSuper (
213
- !compiler .getOptions ().needsTranspilationFrom (FeatureSet .ES2015 ))
214
- .build ())
198
+ .setInternalFactory ((compiler ) -> new RewriteAsyncIteration .Builder (compiler ).build ())
215
199
.setFeatureSetForChecks ()
216
200
.build ();
217
201
Original file line number Diff line number Diff line change @@ -2622,7 +2622,7 @@ public void testAsyncFunctionSuper() {
2622
2622
"class Baz extends Foo {" ,
2623
2623
" bar() {" ,
2624
2624
" const $jscomp$async$this = this, $jscomp$async$super$get$bar =" ,
2625
- " () => Object.getPrototypeOf(Object.getPrototypeOf(this)) .bar;" ,
2625
+ " () => super .bar;" ,
2626
2626
" return $jscomp.asyncExecutePromiseGeneratorFunction(function*() {" ,
2627
2627
" yield Promise.resolve();" ,
2628
2628
" $jscomp$async$super$get$bar().call($jscomp$async$this);" ,
@@ -2676,7 +2676,7 @@ public void testAsyncIterationSuper() {
2676
2676
" bar() {" ,
2677
2677
" const $jscomp$asyncIter$this = this," ,
2678
2678
" $jscomp$asyncIter$super$get$bar =" ,
2679
- " () => Object.getPrototypeOf(Object.getPrototypeOf(this)) .bar;" ,
2679
+ " () => super .bar;" ,
2680
2680
" return new $jscomp.AsyncGeneratorWrapper(function*() {" ,
2681
2681
" $jscomp$asyncIter$super$get$bar().call($jscomp$asyncIter$this).next();" ,
2682
2682
" }());" ,
You can’t perform that action at this time.
0 commit comments