mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
Merge pull request #361 from taylorzane/gh-345
Changed `create` API method to use `new Function()`
This commit is contained in:
commit
4e95404f02
@ -57,7 +57,7 @@ export function create ( source, _options = {} ) {
|
||||
|
||||
let result;
|
||||
try {
|
||||
result = ( 1, eval )( compiled.code );
|
||||
result = (new Function( 'return ' + compiled.code ))();
|
||||
} catch ( err ) {
|
||||
if ( _options.onerror ) {
|
||||
_options.onerror( err );
|
||||
|
Loading…
Reference in New Issue
Block a user