From: Cheng Zhao Date: Mon, 30 Jun 2014 02:06:10 +0000 (+0800) Subject: Fix using common modules. X-Git-Tag: v0.14.0~1^2~71 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=750148f7b4518935e852e766c7ffbd9a9e96e70c;p=electron.git Fix using common modules. --- diff --git a/atom/common/lib/init.coffee b/atom/common/lib/init.coffee index 35ad5e51..5da02744 100644 --- a/atom/common/lib/init.coffee +++ b/atom/common/lib/init.coffee @@ -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