* Low-level execution of JS code in context
(code: string, filename: string, context?: Context)
| 667 | * Low-level execution of JS code in context |
| 668 | */ |
| 669 | function runInContext(code: string, filename: string, context?: Context) { |
| 670 | const script = new Script(code, { filename }); |
| 671 | |
| 672 | if (context === undefined || context === global) { |
| 673 | return script.runInThisContext(); |
| 674 | } else { |
| 675 | return script.runInContext(context); |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | /** |
| 680 | * Append to the eval instance and return an undo function. |
no outgoing calls
no test coverage detected
searching dependent graphs…