mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Enable harmony collections, also revert previous WeakMap hack.
Fixed atom/atom-shell#7.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user