From d1700c045b1ed9f2cdf4250793e554483bdbc752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Mon, 12 Aug 2019 10:34:45 +0800 Subject: [PATCH 01/25] Update Graph.ts --- src/Graph.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Graph.ts b/src/Graph.ts index 871994d972c..e059e176160 100644 --- a/src/Graph.ts +++ b/src/Graph.ts @@ -168,7 +168,7 @@ export default class Graph { this.getModuleContext = () => this.context; } - this.acornOptions = options.acorn || {}; + this.acornOptions = options.acorn ? Object.assign({}, options.acorn) : {}; const acornPluginsToInject = []; acornPluginsToInject.push(injectDynamicImportPlugin); From 103201524568de0554a5d3ef8d86f2f8f81526d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 17:26:48 +0800 Subject: [PATCH 02/25] Update misc.js --- test/misc/misc.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/misc/misc.js b/test/misc/misc.js index 4640a9fcbd7..46fecaaf56b 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -3,6 +3,39 @@ const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('misc', () => { + it('throw modification of options', () => { + const handler = Object.assign(Object.create(null), { + get () { return protect(Reflect.get(...arguments)); }, + getOwnPropertyDescriptor () { + const descriptor = Reflect.getOwnPropertyDescriptor(...arguments); + if ( descriptor.hasOwnProperty('value') ) { + descriptor.value = protect(descriptor.value); + } + return descriptor; + }, + set () { throw Error('set'); }, + deleteProperty () { throw Error('deleteProperty'); }, + defineProperty () { throw Error('defineProperty'); }, + setPrototypeOf () { throw Error('setPrototypeOf'); }, + preventExtensions () { throw Error('preventExtensions'); }, + }); + const cache = new WeakMap; + function protect (option) { + if ( option===null || typeof option!=='object' && typeof option!=='function' ) { return option; } + let proxy = cache.get(option); + proxy || cache.set(option, proxy = new Proxy(option, handler)); + return proxy; + } + return Promise.all([ + { + input: 'input', + plugins: [ loader({ input: `export default 0;` }) ], + acorn: {}, + experimentalTopLevelAwait: true, + }, + ].map(options => rollup.rollup(protect(options)))); + }); + it('warns if node builtins are unresolved in a non-CJS, non-ES bundle (#1051)', () => { const warnings = []; From 767427b26155ee3e87eef4fe44ffe55e8133d49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 17:28:50 +0800 Subject: [PATCH 03/25] Update misc.js --- test/misc/misc.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index 46fecaaf56b..f0f7fc66dcd 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -6,13 +6,7 @@ describe('misc', () => { it('throw modification of options', () => { const handler = Object.assign(Object.create(null), { get () { return protect(Reflect.get(...arguments)); }, - getOwnPropertyDescriptor () { - const descriptor = Reflect.getOwnPropertyDescriptor(...arguments); - if ( descriptor.hasOwnProperty('value') ) { - descriptor.value = protect(descriptor.value); - } - return descriptor; - }, + getOwnPropertyDescriptor () { const descriptor = Reflect.getOwnPropertyDescriptor(...arguments); if ( descriptor.hasOwnProperty('value') ) { descriptor.value = protect(descriptor.value); } return descriptor; }, set () { throw Error('set'); }, deleteProperty () { throw Error('deleteProperty'); }, defineProperty () { throw Error('defineProperty'); }, @@ -22,9 +16,7 @@ describe('misc', () => { const cache = new WeakMap; function protect (option) { if ( option===null || typeof option!=='object' && typeof option!=='function' ) { return option; } - let proxy = cache.get(option); - proxy || cache.set(option, proxy = new Proxy(option, handler)); - return proxy; + let proxy = cache.get(option); proxy || cache.set(option, proxy = new Proxy(option, handler)); return proxy; } return Promise.all([ { From bd062eee246ff7cecab5f784075c638d49c4c97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 17:40:28 +0800 Subject: [PATCH 04/25] Update misc.js --- test/misc/misc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index f0f7fc66dcd..82c69084dd7 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -7,11 +7,11 @@ describe('misc', () => { const handler = Object.assign(Object.create(null), { get () { return protect(Reflect.get(...arguments)); }, getOwnPropertyDescriptor () { const descriptor = Reflect.getOwnPropertyDescriptor(...arguments); if ( descriptor.hasOwnProperty('value') ) { descriptor.value = protect(descriptor.value); } return descriptor; }, - set () { throw Error('set'); }, - deleteProperty () { throw Error('deleteProperty'); }, - defineProperty () { throw Error('defineProperty'); }, - setPrototypeOf () { throw Error('setPrototypeOf'); }, - preventExtensions () { throw Error('preventExtensions'); }, + set () { throw assert.fail('set'); }, + deleteProperty () { throw assert.fail('deleteProperty'); }, + defineProperty () { throw assert.fail('defineProperty'); }, + setPrototypeOf () { throw assert.fail('setPrototypeOf'); }, + preventExtensions () { throw assert.fail('preventExtensions'); }, }); const cache = new WeakMap; function protect (option) { From 2a8aae0540d622a6d70bc8ef725871d4276bb2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 18:09:00 +0800 Subject: [PATCH 05/25] Update misc.js --- test/misc/misc.js | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index 82c69084dd7..b5ff16678e9 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -3,29 +3,19 @@ const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('misc', () => { - it('throw modification of options', () => { - const handler = Object.assign(Object.create(null), { - get () { return protect(Reflect.get(...arguments)); }, - getOwnPropertyDescriptor () { const descriptor = Reflect.getOwnPropertyDescriptor(...arguments); if ( descriptor.hasOwnProperty('value') ) { descriptor.value = protect(descriptor.value); } return descriptor; }, - set () { throw assert.fail('set'); }, - deleteProperty () { throw assert.fail('deleteProperty'); }, - defineProperty () { throw assert.fail('defineProperty'); }, - setPrototypeOf () { throw assert.fail('setPrototypeOf'); }, - preventExtensions () { throw assert.fail('preventExtensions'); }, - }); - const cache = new WeakMap; - function protect (option) { - if ( option===null || typeof option!=='object' && typeof option!=='function' ) { return option; } - let proxy = cache.get(option); proxy || cache.set(option, proxy = new Proxy(option, handler)); return proxy; - } - return Promise.all([ - { + it('throw modification of options.acorn', () => { + const acorn = {}; + return rollup + .rollup({ input: 'input', plugins: [ loader({ input: `export default 0;` }) ], - acorn: {}, + acorn, experimentalTopLevelAwait: true, - }, - ].map(options => rollup.rollup(protect(options)))); + }) + .then(() => { + assert.deepEqual(acorn, {}); + assert.deepEqual({}, acorn); + }); }); it('warns if node builtins are unresolved in a non-CJS, non-ES bundle (#1051)', () => { From d1e3acc74db6d8c096a2d9dd00528caa4179e9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 18:13:19 +0800 Subject: [PATCH 06/25] Update misc.js --- test/misc/misc.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index b5ff16678e9..45139fc384d 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -4,17 +4,14 @@ const { loader } = require('../utils.js'); describe('misc', () => { it('throw modification of options.acorn', () => { - const acorn = {}; + const $ = Object.freeze; + return rollup .rollup({ input: 'input', plugins: [ loader({ input: `export default 0;` }) ], - acorn, + acorn: $({}), experimentalTopLevelAwait: true, - }) - .then(() => { - assert.deepEqual(acorn, {}); - assert.deepEqual({}, acorn); }); }); From 905905aa9aa59844185a5362689110bc4d1ca0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 18:19:53 +0800 Subject: [PATCH 07/25] Update misc.js --- test/misc/misc.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index 45139fc384d..1bcafc1535c 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -4,13 +4,11 @@ const { loader } = require('../utils.js'); describe('misc', () => { it('throw modification of options.acorn', () => { - const $ = Object.freeze; - return rollup .rollup({ input: 'input', plugins: [ loader({ input: `export default 0;` }) ], - acorn: $({}), + acorn: Object.freeze({}), experimentalTopLevelAwait: true, }); }); From b8e07ed5776fa61df562133b70ef4f4003b555cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:23:10 +0800 Subject: [PATCH 08/25] Update misc.js --- test/misc/misc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index 1bcafc1535c..22d374e7fb9 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -7,7 +7,9 @@ describe('misc', () => { return rollup .rollup({ input: 'input', - plugins: [ loader({ input: `export default 0;` }) ], + plugins: Object.freeze([ + loader({ input: `export default 0;` }) + ]), acorn: Object.freeze({}), experimentalTopLevelAwait: true, }); From 0ebde996619870b9f4726976995e4135b35c272b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:23:58 +0800 Subject: [PATCH 09/25] Update misc.js --- test/misc/misc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index 22d374e7fb9..ee9cb5f869d 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -8,7 +8,9 @@ describe('misc', () => { .rollup({ input: 'input', plugins: Object.freeze([ - loader({ input: `export default 0;` }) + loader({ + input: `export default 0;` + }) ]), acorn: Object.freeze({}), experimentalTopLevelAwait: true, From 2add7e01646f61f1d0fbf0d6b0adb3ef96b99c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:27:12 +0800 Subject: [PATCH 10/25] Update index.ts --- src/rollup/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 1f8798e1604..39fc2983b18 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -184,7 +184,6 @@ export default async function rollup(rawInputOptions: GenericConfigObject): Prom // remove the cache option from the memory after graph creation (cache is not used anymore) const useCache = rawInputOptions.cache !== false; delete inputOptions.cache; - delete rawInputOptions.cache; timeStart('BUILD', 1); From ea5e2987b90951abda6c6cf7d85047da3dde7ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:29:15 +0800 Subject: [PATCH 11/25] Update utils.js --- test/utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/utils.js b/test/utils.js index d21f62e33d9..d7c1260f06c 100644 --- a/test/utils.js +++ b/test/utils.js @@ -117,7 +117,10 @@ function removeOldTest(dir) { } function loader(modules) { + modules = Object.assign(Object.create(null), modules); return { + name: 'loader', + resolveId(id) { return id in modules ? id : null; }, From 838932e83168f1c79adece604264138e2e1d1be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:32:37 +0800 Subject: [PATCH 12/25] Update misc.js --- test/misc/misc.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index ee9cb5f869d..0f9b6fba519 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -4,17 +4,21 @@ const { loader } = require('../utils.js'); describe('misc', () => { it('throw modification of options.acorn', () => { + const { freeze } = Object; return rollup - .rollup({ + .rollup(freeze({ input: 'input', - plugins: Object.freeze([ - loader({ - input: `export default 0;` - }) + plugins: freeze([ + freeze({ + name: 'loader', + resolveId: () => 'input', + load: `export default 0;`, + }), ]), - acorn: Object.freeze({}), + cache: false, + acorn: freeze({}), experimentalTopLevelAwait: true, - }); + })); }); it('warns if node builtins are unresolved in a non-CJS, non-ES bundle (#1051)', () => { From 90d456c06f52e583f34b34825b6444e923cd7a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:33:46 +0800 Subject: [PATCH 13/25] Update misc.js --- test/misc/misc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index 0f9b6fba519..e44facbdcf2 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -3,7 +3,7 @@ const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('misc', () => { - it('throw modification of options.acorn', () => { + it('throw modification of options or its property', () => { const { freeze } = Object; return rollup .rollup(freeze({ From c72c38648272e0ff61fb10ca19577c7c42e492a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:41:56 +0800 Subject: [PATCH 14/25] Update misc.js --- test/misc/misc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index e44facbdcf2..6e56d0b4ea0 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -12,7 +12,7 @@ describe('misc', () => { freeze({ name: 'loader', resolveId: () => 'input', - load: `export default 0;`, + load: () => `export default 0;`, }), ]), cache: false, From 1241296092b2b344bb8b26953c9c2a6b655fa095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:51:51 +0800 Subject: [PATCH 15/25] Update misc.js --- test/misc/misc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/misc/misc.js b/test/misc/misc.js index 6e56d0b4ea0..1f15d4400ad 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -8,6 +8,7 @@ describe('misc', () => { return rollup .rollup(freeze({ input: 'input', + external: freeze([]), plugins: freeze([ freeze({ name: 'loader', From a4b7d775d4d3f0110bca49825f8363eb8d534594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 20:54:45 +0800 Subject: [PATCH 16/25] Update misc.js --- test/misc/misc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index 1f15d4400ad..d1a7df7bbaf 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -12,8 +12,8 @@ describe('misc', () => { plugins: freeze([ freeze({ name: 'loader', - resolveId: () => 'input', - load: () => `export default 0;`, + resolveId: freeze(() => 'input'), + load: freeze(() => `export default 0;`), }), ]), cache: false, From f5a33ebceda8ee72a23f059725f1bb2bd904067c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 21:16:36 +0800 Subject: [PATCH 17/25] Update misc.js --- test/misc/misc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index d1a7df7bbaf..bc0f14162b1 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -16,7 +16,7 @@ describe('misc', () => { load: freeze(() => `export default 0;`), }), ]), - cache: false, + //cache: false, acorn: freeze({}), experimentalTopLevelAwait: true, })); From c2f5e168e55de75754429787e8ed30cd02f77d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 21:17:10 +0800 Subject: [PATCH 18/25] Update index.ts --- src/rollup/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 39fc2983b18..1f8798e1604 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -184,6 +184,7 @@ export default async function rollup(rawInputOptions: GenericConfigObject): Prom // remove the cache option from the memory after graph creation (cache is not used anymore) const useCache = rawInputOptions.cache !== false; delete inputOptions.cache; + delete rawInputOptions.cache; timeStart('BUILD', 1); From e13e23ca74e64fb9667546e78b5812e57ed69c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 21:21:48 +0800 Subject: [PATCH 19/25] Update utils.js --- test/utils.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/utils.js b/test/utils.js index d7c1260f06c..d21f62e33d9 100644 --- a/test/utils.js +++ b/test/utils.js @@ -117,10 +117,7 @@ function removeOldTest(dir) { } function loader(modules) { - modules = Object.assign(Object.create(null), modules); return { - name: 'loader', - resolveId(id) { return id in modules ? id : null; }, From 9c3e5761828e9d7d6b20176e6ffb19fcbb796ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 21:29:51 +0800 Subject: [PATCH 20/25] Update index.ts --- src/rollup/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 1f8798e1604..39fc2983b18 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -184,7 +184,6 @@ export default async function rollup(rawInputOptions: GenericConfigObject): Prom // remove the cache option from the memory after graph creation (cache is not used anymore) const useCache = rawInputOptions.cache !== false; delete inputOptions.cache; - delete rawInputOptions.cache; timeStart('BUILD', 1); From 1b2669e8d42d47a729699fd0fd1ffb9de7bdeff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 21:34:26 +0800 Subject: [PATCH 21/25] Update index.ts --- src/rollup/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rollup/index.ts b/src/rollup/index.ts index 39fc2983b18..1f8798e1604 100644 --- a/src/rollup/index.ts +++ b/src/rollup/index.ts @@ -184,6 +184,7 @@ export default async function rollup(rawInputOptions: GenericConfigObject): Prom // remove the cache option from the memory after graph creation (cache is not used anymore) const useCache = rawInputOptions.cache !== false; delete inputOptions.cache; + delete rawInputOptions.cache; timeStart('BUILD', 1); From 0c559b2f350bb3b69569b5a28c34cbecd91a4bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 21:39:05 +0800 Subject: [PATCH 22/25] Update utils.js --- test/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/utils.js b/test/utils.js index d21f62e33d9..2506c74d9d7 100644 --- a/test/utils.js +++ b/test/utils.js @@ -117,6 +117,7 @@ function removeOldTest(dir) { } function loader(modules) { + modules = Object.assign(Object.create(null), modules); return { resolveId(id) { return id in modules ? id : null; From 4c34fd24797fa6bb315f2af046e5113798b7aba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Tue, 13 Aug 2019 21:46:14 +0800 Subject: [PATCH 23/25] Update misc.js --- test/misc/misc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/misc/misc.js b/test/misc/misc.js index bc0f14162b1..ef541e5e43f 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -17,8 +17,10 @@ describe('misc', () => { }), ]), //cache: false, + acornInjectPlugins: freeze([]), acorn: freeze({}), experimentalTopLevelAwait: true, + treeshake: freeze({}), })); }); From b7f3978f61472d65c8d17f7c659c061c018b9651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E9=81=93?= Date: Wed, 14 Aug 2019 08:11:45 +0800 Subject: [PATCH 24/25] Update misc.js --- test/misc/misc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/misc/misc.js b/test/misc/misc.js index ef541e5e43f..c2653cb3456 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -11,11 +11,13 @@ describe('misc', () => { external: freeze([]), plugins: freeze([ freeze({ + // remove the name field, when rollup don't add auto name to plugin directly any more: name: 'loader', resolveId: freeze(() => 'input'), load: freeze(() => `export default 0;`), }), ]), + // remove the comment mark, when rollup don't delete rawInputOptions.cache any more: //cache: false, acornInjectPlugins: freeze([]), acorn: freeze({}), From 3e138190cfde3158ae68ac0a5814c4697df60521 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 14 Aug 2019 07:59:13 +0200 Subject: [PATCH 25/25] Remove freezes where it is unlikely Rollup will fix them --- test/misc/misc.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/misc/misc.js b/test/misc/misc.js index c2653cb3456..2cd6bf0878a 100644 --- a/test/misc/misc.js +++ b/test/misc/misc.js @@ -5,25 +5,23 @@ const { loader } = require('../utils.js'); describe('misc', () => { it('throw modification of options or its property', () => { const { freeze } = Object; - return rollup - .rollup(freeze({ + return rollup.rollup( + freeze({ input: 'input', external: freeze([]), plugins: freeze([ - freeze({ - // remove the name field, when rollup don't add auto name to plugin directly any more: + { name: 'loader', resolveId: freeze(() => 'input'), - load: freeze(() => `export default 0;`), - }), + load: freeze(() => `export default 0;`) + } ]), - // remove the comment mark, when rollup don't delete rawInputOptions.cache any more: - //cache: false, acornInjectPlugins: freeze([]), acorn: freeze({}), experimentalTopLevelAwait: true, - treeshake: freeze({}), - })); + treeshake: freeze({}) + }) + ); }); it('warns if node builtins are unresolved in a non-CJS, non-ES bundle (#1051)', () => {