File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,9 @@ function setupMemoryUsage(_memoryUsage) {
109109function setupConfig ( _source ) {
110110 // NativeModule._source
111111 // used for `process.config`, but not a real module
112- var config = _source . config ;
112+ const config = _source . config ;
113113 delete _source . config ;
114114
115- // strip the gyp comment line at the beginning
116- config = config . split ( '\n' )
117- . slice ( 1 )
118- . join ( '\n' )
119- . replace ( / " / g, '\\"' )
120- . replace ( / ' / g, '"' ) ;
121-
122115 process . config = JSON . parse ( config , function ( key , value ) {
123116 if ( value === 'true' ) return true ;
124117 if ( value === 'false' ) return false ;
Original file line number Diff line number Diff line change @@ -261,6 +261,11 @@ def JS2C(source, target):
261261 if '/' in name or '\\ ' in name :
262262 name = '/' .join (re .split ('/|\\ \\ ' , name )[1 :])
263263
264+ # if its a gypi file we're going to want it as json
265+ # later on anyway, so get it out of the way now
266+ if name .endswith (".gypi" ):
267+ lines = re .sub (r'#.*?\n' , '' , lines )
268+ lines = re .sub (r'\'' , '"' , lines )
264269 name = name .split ('.' , 1 )[0 ]
265270 var = name .replace ('-' , '_' ).replace ('/' , '_' )
266271 key = '%s_key' % var
You can’t perform that action at this time.
0 commit comments