Skip to content

Commit 26c6031

Browse files
authored
Fix class literal scan (#4906)
This patch fixes #4892 JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz [email protected]
1 parent 53b61c1 commit 26c6031

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

jerry-core/parser/js/js-scanner-util.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,17 +1839,12 @@ scanner_push_class_declaration (parser_context_t *context_p, /**< context */
18391839

18401840
if (class_has_name)
18411841
{
1842-
if (stack_mode == SCAN_STACK_CLASS_STATEMENT)
1843-
{
1844-
literal_p = scanner_add_literal (context_p, scanner_context_p);
1845-
scanner_context_p->active_literal_pool_p->no_declarations++;
1846-
}
1842+
literal_p = scanner_add_literal (context_p, scanner_context_p);
1843+
scanner_context_p->active_literal_pool_p->no_declarations++;
1844+
18471845
#if JERRY_MODULE_SYSTEM
1848-
else if (is_export_default)
1846+
if (is_export_default)
18491847
{
1850-
literal_p = scanner_add_literal (context_p, scanner_context_p);
1851-
scanner_context_p->active_literal_pool_p->no_declarations++;
1852-
18531848
scanner_detect_invalid_let (context_p, literal_p);
18541849

18551850
if (literal_p->type & SCANNER_LITERAL_IS_USED)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 MyArray extends class C{}
16+
{};

tests/test262-esnext-excludelist.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<test id="built-ins/BigInt/asUintN/length.js"><reason></reason></test>
2929
<test id="built-ins/BigInt/asUintN/name.js"><reason></reason></test>
3030
<test id="built-ins/BigInt/asUintN/order-of-steps.js"><reason></reason></test>
31-
<test id="built-ins/Function/prototype/toString/class-declaration-complex-heritage.js"><reason></reason></test>
3231
<test id="built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js"><reason></reason></test>
3332
<test id="built-ins/Function/prototype/toString/class-expression-explicit-ctor.js"><reason></reason></test>
3433
<test id="built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js"><reason></reason></test>

0 commit comments

Comments
 (0)