GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: V8: cherry-pick 6a4cd97d6691 · nodejs/node@86c7c0a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8
    • src/ast
      • ast-function-literal-id-reindexer.cc
    • test/mjsunit/regress
      • regress-1132111.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.34',
39+
'v8_embedder_string': '-node.35',
4040

4141
##### V8 defaults for Node.js #####
4242

Collapse file

‎deps/v8/src/ast/ast-function-literal-id-reindexer.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/ast/ast-function-literal-id-reindexer.cc
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ void AstFunctionLiteralIdReindexer::VisitClassLiteral(ClassLiteral* expr) {
5454
// Private fields have their key and value present in
5555
// instance_members_initializer_function, so they will
5656
// already have been visited.
57-
if (prop->value()->IsFunctionLiteral()) {
58-
Visit(prop->value());
59-
} else {
57+
if (prop->kind() == ClassLiteralProperty::Kind::FIELD) {
6058
CheckVisited(prop->value());
59+
} else {
60+
Visit(prop->value());
6161
}
6262
}
6363
ZonePtrList<ClassLiteral::Property>* props = expr->public_members();
@@ -67,7 +67,8 @@ void AstFunctionLiteralIdReindexer::VisitClassLiteral(ClassLiteral* expr) {
6767
// Public fields with computed names have their key
6868
// and value present in instance_members_initializer_function, so they will
6969
// already have been visited.
70-
if (prop->is_computed_name() && !prop->value()->IsFunctionLiteral()) {
70+
if (prop->is_computed_name() &&
71+
prop->kind() == ClassLiteralProperty::Kind::FIELD) {
7172
if (!prop->key()->IsLiteral()) {
7273
CheckVisited(prop->key());
7374
}
Collapse file

‎deps/v8/test/mjsunit/regress/regress-1132111.js‎

Copy file name to clipboard
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2020 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Public function field with computed name
6+
eval(`
7+
buggy = ((bug = new class { [0] = x => 1337.0; }) => bug);
8+
`);
9+
10+
// Public method with computed name
11+
eval(`
12+
buggy = ((bug = new class { [0](x) { return 1337.0}; }) => bug);
13+
`);
14+
15+
// Private function field with computed name
16+
eval(`
17+
buggy = ((bug = new class { #foo = x => 1337.0; }) => bug);
18+
`);
19+
20+
// Private method with computed name
21+
eval(`
22+
buggy = ((bug = new class { #foo(x) { return 1337.0; } }) => bug);
23+
`);

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.