Merge pull request #2215 from atom/delete-global

Don't expose "global" when node integration is off
This commit is contained in:
Cheng Zhao 2015-07-14 09:53:44 -07:00
commit 076942ca7a
3 changed files with 3 additions and 2 deletions

View file

@ -93,6 +93,7 @@ else
delete global.process delete global.process
delete global.setImmediate delete global.setImmediate
delete global.clearImmediate delete global.clearImmediate
delete global.global
# Load the script specfied by the "preload" attribute. # Load the script specfied by the "preload" attribute.
if preloadScript if preloadScript

View file

@ -1,7 +1,7 @@
<html> <html>
<body> <body>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
console.log([typeof require, typeof module, typeof process].join(' ')); console.log([typeof require, typeof module, typeof process, typeof global].join(' '));
</script> </script>
</body> </body>
</html> </html>

View file

@ -34,7 +34,7 @@ describe '<webview> tag', ->
describe 'nodeintegration attribute', -> describe 'nodeintegration attribute', ->
it 'inserts no node symbols when not set', (done) -> it 'inserts no node symbols when not set', (done) ->
webview.addEventListener 'console-message', (e) -> webview.addEventListener 'console-message', (e) ->
assert.equal e.message, 'undefined undefined undefined' assert.equal e.message, 'undefined undefined undefined undefined'
done() done()
webview.src = "file://#{fixtures}/pages/c.html" webview.src = "file://#{fixtures}/pages/c.html"
document.body.appendChild webview document.body.appendChild webview