f4dfb6fbe1
Before evaluating a module, all variables declared at the top-level in _any_ of the modules in the dependency graph must be initialized. This is observable because a module A can access a variable imported from module B (e.g. a function) at a point when module B's body hasn't been evaluated yet. We achieve this by implementing modules internally as generators with two states (not initialized, initialized). R=adamk@chromium.org BUG=v8:1569 Review-Url: https://codereview.chromium.org/2375793002 Cr-Commit-Position: refs/heads/master@{#39871}
10 lines
344 B
JavaScript
10 lines
344 B
JavaScript
// Copyright 2016 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.
|
|
//
|
|
// MODULE
|
|
|
|
// Make sure the generator resume function doesn't show up in the stack trace.
|
|
const stack = (new Error).stack;
|
|
assertEquals(2, stack.split(/\r\n|\r|\n/).length);
|