File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -2861,7 +2861,7 @@ scanner_scan_all (parser_context_t *context_p) /**< context */
2861
2861
continue ;
2862
2862
}
2863
2863
2864
- if (literal_pool_flags != SCANNER_LITERAL_POOL_FUNCTION )
2864
+ if (literal_pool_flags & SCANNER_LITERAL_POOL_GENERATOR )
2865
2865
{
2866
2866
scanner_raise_error (context_p );
2867
2867
}
Original file line number Diff line number Diff line change
1
+ // Copyright JS Foundation and other contributors, http://js.foundation
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ class C1 { async }
16
+ class C2 { async ; constructor ( ) { } }
17
+ class C3 { async = 5.1 ; constructor ( ) { } }
18
+
19
+ assert ( ( new C1 ) . async === undefined ) ;
20
+ assert ( ( new C2 ) . async === undefined ) ;
21
+ assert ( ( new C3 ) . async === 5.1 ) ;
22
+
23
+ try {
24
+ eval ( 'class C1 { async* }' ) ;
25
+ assert ( false ) ;
26
+ } catch ( e ) {
27
+ assert ( e instanceof SyntaxError ) ;
28
+ }
29
+
You can’t perform that action at this time.
0 commit comments