Enable harmony collections, also revert previous WeakMap hack.

Fixed atom/atom-shell#7.
This commit is contained in:
Cheng Zhao
2013-05-17 16:21:01 +08:00
parent 8487536280
commit 02e3f4cd9c
2 changed files with 4 additions and 9 deletions

View File

@@ -13,10 +13,14 @@ class BrowserMain
constructor: ->
@windowState = {}
@setupJavaScriptArguments()
@parseCommandLine()
@setupNodePaths()
@handleEvents()
setupJavaScriptArguments: ->
app.commandLine.appendSwitch 'js-flags', '--harmony_collections'
parseCommandLine: ->
modifiedArgv = ['node'].concat(process.argv) # optimist assumes the first arg will be node
args = optimist(modifiedArgv).argv

View File

@@ -1,14 +1,5 @@
_ = require 'underscore'
class WeakMap
constructor: ->
@map = {}
set: (key, value) -> @map[key] = value
get: (key) -> @map[key]
delete: (key) -> delete @map[key]
has: (key) -> @map[key]?
module.exports =
subscribe: (eventEmitter, eventName, callback) ->
eventEmitter.on eventName, callback