Fix using common modules.

This commit is contained in:
Cheng Zhao 2014-06-30 10:06:10 +08:00
parent 6ddb8c00dc
commit 750148f7b4

View file

@ -2,7 +2,11 @@ path = require 'path'
timers = require 'timers'
Module = require 'module'
process.atomBinding = (name) -> process.binding "atom_#{process.type}_#{name}"
process.atomBinding = (name) ->
try
process.binding "atom_#{process.type}_#{name}"
catch e
process.binding "atom_common_#{name}" if e.message is 'No such module'
# Add common/api/lib to module search paths.
globalPaths = Module.globalPaths