diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db2454c..a80c190 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Install V8 + run: | + brew update + brew install v8 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/lib/execjs/support/v8_runner.js b/lib/execjs/support/v8_runner.js index c57a944..1b2a89c 100644 --- a/lib/execjs/support/v8_runner.js +++ b/lib/execjs/support/v8_runner.js @@ -1,7 +1,14 @@ -(function(program, execJS) { execJS(program) })(function() { #{source} +(function(program, execJS) { execJS(program) })(function(console, setTimeout, setInterval, clearTimeout, clearInterval, setImmediate, clearImmediate) { #{source} }, function(program) { var output; try { + delete this.console; + delete this.setTimeout; + delete this.setInterval; + delete this.clearTimeout; + delete this.clearInterval; + delete this.setImmediate; + delete this.clearImmediate; result = program(); if (typeof result == 'undefined' && result !== null) { print('["ok"]');