mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
This brings back several improvements that were reverted by mistake when landing https://redirect.github.com/nodejs/node/pull/64154 - Update the documentation about how the removal of side effects of source collection - Add non-enumerable `requireStack` and `topLevelAwaitLocations` properties to `ERR_REQUIRE_ASYNC_MODULE`, the latter is only populated when --experimental-print-required-tla is enabled - Add "Required module: <url>" to the error message to identify the required ESM entry point regardless of whether the flag is enabled - Fix TLA caret column from 0-based to 1-based - Store module source via a private symbol instead of a public property - Use `hasAsyncGraph` (post-instantiation) in `throwIfAsyncGraph` instead of walking the graph before instantiation - Merge the require stack checking into the `common.expectRequiredTLAError` helper. - Removed tests that are made redundant by the snapshot tests Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: https://github.com/nodejs/node/pull/64260 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
14 lines
318 B
JavaScript
14 lines
318 B
JavaScript
'use strict';
|
|
|
|
// Tests that require(esm) throws for top-level-await in inner graphs.
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.throws(() => {
|
|
require('../fixtures/es-modules/tla/parent.mjs');
|
|
}, (err) => {
|
|
common.expectRequiredTLAError(err, [__filename]);
|
|
return true;
|
|
});
|