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 @@ -122,16 +122,9 @@ function setupMemoryUsage() {
122
122
function setupConfig ( _source ) {
123
123
// NativeModule._source
124
124
// used for `process.config`, but not a real module
125
- var config = _source . config ;
125
+ const config = _source . config ;
126
126
delete _source . config ;
127
127
128
- // strip the gyp comment line at the beginning
129
- config = config . split ( '\n' )
130
- . slice ( 1 )
131
- . join ( '\n' )
132
- . replace ( / " / g, '\\"' )
133
- . replace ( / ' / g, '"' ) ;
134
-
135
128
process . config = JSON . parse ( config , function ( key , value ) {
136
129
if ( value === 'true' ) return true ;
137
130
if ( value === 'false' ) return false ;
Original file line number Diff line number Diff line change @@ -288,6 +288,11 @@ def JS2C(source, target):
288
288
split = split [1 :]
289
289
name = '/' .join (split )
290
290
291
+ # if its a gypi file we're going to want it as json
292
+ # later on anyway, so get it out of the way now
293
+ if name .endswith (".gypi" ):
294
+ lines = re .sub (r'#.*?\n' , '' , lines )
295
+ lines = re .sub (r'\'' , '"' , lines )
291
296
name = name .split ('.' , 1 )[0 ]
292
297
var = name .replace ('-' , '_' ).replace ('/' , '_' )
293
298
key = '%s_key' % var
You can’t perform that action at this time.
0 commit comments