0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00

use new Function instead of eval, to prevent Rollup complaining

This commit is contained in:
Rich Harris 2018-04-17 17:22:39 -04:00
parent 5a457bfb87
commit 69c41a0373

View File

@ -150,7 +150,7 @@ function create(source: string, _options: CompileOptions = {}) {
}
try {
return (0, eval)(compiled.js.code);
return (new Function(compiled.js.code))();
} catch (err) {
if (_options.onerror) {
_options.onerror(err);