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 @@ -128,16 +128,9 @@ function setupMemoryUsage() {
128128function setupConfig ( _source ) {
129129 // NativeModule._source
130130 // used for `process.config`, but not a real module
131- var config = _source . config ;
131+ const config = _source . config ;
132132 delete _source . config ;
133133
134- // strip the gyp comment line at the beginning
135- config = config . split ( '\n' )
136- . slice ( 1 )
137- . join ( '\n' )
138- . replace ( / " / g, '\\"' )
139- . replace ( / ' / g, '"' ) ;
140-
141134 process . config = JSON . parse ( config , function ( key , value ) {
142135 if ( value === 'true' ) return true ;
143136 if ( value === 'false' ) return false ;
Original file line number Diff line number Diff line change @@ -292,6 +292,11 @@ def JS2C(source, target):
292292 split = split [1 :]
293293 name = '/' .join (split )
294294
295+ # if its a gypi file we're going to want it as json
296+ # later on anyway, so get it out of the way now
297+ if name .endswith (".gypi" ):
298+ lines = re .sub (r'#.*?\n' , '' , lines )
299+ lines = re .sub (r'\'' , '"' , lines )
295300 name = name .split ('.' , 1 )[0 ]
296301 var = name .replace ('-' , '_' ).replace ('/' , '_' )
297302 key = '%s_key' % var
You can’t perform that action at this time.
0 commit comments