Fix class literal scan (#4906)
This patch fixes #4892 JerryScript-DCO-1.0-Signed-off-by: Daniel Batiz daniel.batiz@h-lab.eu
This commit is contained in:
@@ -1838,18 +1838,13 @@ scanner_push_class_declaration (parser_context_t *context_p, /**< context */
|
||||
(context_p->token.type == LEXER_LITERAL && context_p->token.lit_location.type == LEXER_IDENT_LITERAL);
|
||||
|
||||
if (class_has_name)
|
||||
{
|
||||
if (stack_mode == SCAN_STACK_CLASS_STATEMENT)
|
||||
{
|
||||
literal_p = scanner_add_literal (context_p, scanner_context_p);
|
||||
scanner_context_p->active_literal_pool_p->no_declarations++;
|
||||
}
|
||||
#if JERRY_MODULE_SYSTEM
|
||||
else if (is_export_default)
|
||||
{
|
||||
literal_p = scanner_add_literal (context_p, scanner_context_p);
|
||||
scanner_context_p->active_literal_pool_p->no_declarations++;
|
||||
|
||||
#if JERRY_MODULE_SYSTEM
|
||||
if (is_export_default)
|
||||
{
|
||||
scanner_detect_invalid_let (context_p, literal_p);
|
||||
|
||||
if (literal_p->type & SCANNER_LITERAL_IS_USED)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright JS Foundation and other contributors, http://js.foundation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
class MyArray extends class C{}
|
||||
{};
|
||||
@@ -28,7 +28,6 @@
|
||||
<test id="built-ins/BigInt/asUintN/length.js"><reason></reason></test>
|
||||
<test id="built-ins/BigInt/asUintN/name.js"><reason></reason></test>
|
||||
<test id="built-ins/BigInt/asUintN/order-of-steps.js"><reason></reason></test>
|
||||
<test id="built-ins/Function/prototype/toString/class-declaration-complex-heritage.js"><reason></reason></test>
|
||||
<test id="built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js"><reason></reason></test>
|
||||
<test id="built-ins/Function/prototype/toString/class-expression-explicit-ctor.js"><reason></reason></test>
|
||||
<test id="built-ins/Function/prototype/toString/well-known-intrinsic-object-functions.js"><reason></reason></test>
|
||||
|
||||
Reference in New Issue
Block a user