mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add BIND_DONE event for process object
This commit is contained in:
@@ -23,9 +23,8 @@ process.argv.splice startMark, endMark - startMark + 1
|
||||
globalPaths = module.globalPaths
|
||||
globalPaths.push path.join process.resourcesPath, 'atom', 'browser', 'api', 'lib'
|
||||
|
||||
# Do loading in next tick since we still need some initialize work before
|
||||
# native bindings can work.
|
||||
setImmediate ->
|
||||
# Following operations need extra bindings by AtomBindings.
|
||||
process.once 'BIND_DONE', ->
|
||||
# Import common settings.
|
||||
require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init.js')
|
||||
|
||||
|
||||
@@ -85,6 +85,9 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
|
||||
versions->Set(mate::StringToV8(isolate, "chrome"),
|
||||
mate::StringToV8(isolate, CHROME_VERSION_STRING));
|
||||
}
|
||||
|
||||
v8::Handle<v8::Value> event = mate::StringToV8(isolate, "BIND_DONE");
|
||||
node::MakeCallback(isolate, process, "emit", 1, &event);
|
||||
}
|
||||
|
||||
void AtomBindings::ActivateUVLoop(v8::Isolate* isolate) {
|
||||
|
||||
@@ -84,5 +84,5 @@ if nodeIntegration in ['true', 'all', 'except-iframe', 'manual-enable-iframe']
|
||||
else
|
||||
# There still some native initialization codes needs "process", delete the
|
||||
# global reference after they are done.
|
||||
setImmediate ->
|
||||
process.once 'BIND_DONE', ->
|
||||
delete global.process
|
||||
|
||||
Reference in New Issue
Block a user