From 750148f7b4518935e852e766c7ffbd9a9e96e70c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 30 Jun 2014 10:06:10 +0800 Subject: [PATCH] Fix using common modules. --- atom/common/lib/init.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/atom/common/lib/init.coffee b/atom/common/lib/init.coffee index 35ad5e512d92..5da02744275b 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