0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/es-module/test-esm-forbidden-globals.mjs
Michaël Zasso fddcd6253b
test: move ESM fixtures to fixtures dir
Also consistently import the `common` module where possible.

PR-URL: https://github.com/nodejs/node/pull/19409
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-03-21 20:08:30 +01:00

25 lines
568 B
JavaScript

// Flags: --experimental-modules
import '../common';
if (typeof arguments !== 'undefined') {
throw new Error('not an ESM');
}
if (typeof this !== 'undefined') {
throw new Error('not an ESM');
}
if (typeof exports !== 'undefined') {
throw new Error('not an ESM');
}
if (typeof require !== 'undefined') {
throw new Error('not an ESM');
}
if (typeof module !== 'undefined') {
throw new Error('not an ESM');
}
if (typeof __filename !== 'undefined') {
throw new Error('not an ESM');
}
if (typeof __dirname !== 'undefined') {
throw new Error('not an ESM');
}