94ade104ea
When reparsing the class scope to collect initializers in sloppy mode, the class scope may still have a scope info without any allocated variables. If its outer scope doesn't have an outer scope (which means the outer scope in the optimized scope chain becomes the script scope), we should also set the scope info in the script scope as is done in Scope::DeserializeScopeChain() for the scope resolution. Bug: chromium:1290587, v8:10704 Change-Id: I7804d53f330e59d4ab0405a11b132569f348b55d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3413647 Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Joyee Cheung <joyee@igalia.com> Cr-Commit-Position: refs/heads/main@{#78784}
15 lines
296 B
JavaScript
15 lines
296 B
JavaScript
// Copyright 2022 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
var a = undefined;
|
|
{
|
|
class C {
|
|
field = a.instantiate();
|
|
}
|
|
|
|
assertThrows(() => {
|
|
let c = new C;
|
|
}, TypeError);
|
|
}
|