diff options
author | Giorgos Ntemiris <ntemirisgiorgos3@gmail.com> | 2019-07-27 20:23:25 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-08-13 11:19:48 -0700 |
commit | 427e5348a267b7c88879b47f8d942fc3e84b30e9 (patch) | |
tree | 1f0cd8630b7754cb15a343854bdb9ae0fd0cc444 /test/fixtures | |
parent | a49b20d3245dd2a4d890e28582f3c013c07c3136 (diff) | |
download | android-node-v8-427e5348a267b7c88879b47f8d942fc3e84b30e9.tar.gz android-node-v8-427e5348a267b7c88879b47f8d942fc3e84b30e9.tar.bz2 android-node-v8-427e5348a267b7c88879b47f8d942fc3e84b30e9.zip |
module: add warning when import,export is detected in CJS context
This will allow users to know how to change their project to support
ES modules.
PR-URL: https://github.com/nodejs/node/pull/28950
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Diffstat (limited to 'test/fixtures')
7 files changed, 11 insertions, 0 deletions
diff --git a/test/fixtures/es-modules/es-note-promiserej-import-2.cjs b/test/fixtures/es-modules/es-note-promiserej-import-2.cjs new file mode 100644 index 0000000000..e9da32086f --- /dev/null +++ b/test/fixtures/es-modules/es-note-promiserej-import-2.cjs @@ -0,0 +1 @@ +import('valid'); diff --git a/test/fixtures/es-modules/es-note-unexpected-export-1.cjs b/test/fixtures/es-modules/es-note-unexpected-export-1.cjs new file mode 100644 index 0000000000..3e2612ed35 --- /dev/null +++ b/test/fixtures/es-modules/es-note-unexpected-export-1.cjs @@ -0,0 +1,2 @@ +const example = 10; +export default example; diff --git a/test/fixtures/es-modules/es-note-unexpected-export-2.cjs b/test/fixtures/es-modules/es-note-unexpected-export-2.cjs new file mode 100644 index 0000000000..637bac9616 --- /dev/null +++ b/test/fixtures/es-modules/es-note-unexpected-export-2.cjs @@ -0,0 +1,4 @@ +const config = 10; +export { + config +}; diff --git a/test/fixtures/es-modules/es-note-unexpected-import-1.cjs b/test/fixtures/es-modules/es-note-unexpected-import-1.cjs new file mode 100644 index 0000000000..232259b06f --- /dev/null +++ b/test/fixtures/es-modules/es-note-unexpected-import-1.cjs @@ -0,0 +1 @@ +import "invalid"; diff --git a/test/fixtures/es-modules/es-note-unexpected-import-3.cjs b/test/fixtures/es-modules/es-note-unexpected-import-3.cjs new file mode 100644 index 0000000000..5d2d3029e3 --- /dev/null +++ b/test/fixtures/es-modules/es-note-unexpected-import-3.cjs @@ -0,0 +1 @@ +import x, { y } from 'xyz' diff --git a/test/fixtures/es-modules/es-note-unexpected-import-4.cjs b/test/fixtures/es-modules/es-note-unexpected-import-4.cjs new file mode 100644 index 0000000000..5e265ba054 --- /dev/null +++ b/test/fixtures/es-modules/es-note-unexpected-import-4.cjs @@ -0,0 +1 @@ +import * as coordinates from 'xyz' diff --git a/test/fixtures/es-modules/es-note-unexpected-import-5.cjs b/test/fixtures/es-modules/es-note-unexpected-import-5.cjs new file mode 100644 index 0000000000..f38c3ee1a5 --- /dev/null +++ b/test/fixtures/es-modules/es-note-unexpected-import-5.cjs @@ -0,0 +1 @@ +import ('invalid') |