File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -118,16 +118,9 @@ function setupMemoryUsage() {
118
118
function setupConfig ( _source ) {
119
119
// NativeModule._source
120
120
// used for `process.config`, but not a real module
121
- var config = _source . config ;
121
+ const config = _source . config ;
122
122
delete _source . config ;
123
123
124
- // strip the gyp comment line at the beginning
125
- config = config . split ( '\n' )
126
- . slice ( 1 )
127
- . join ( '\n' )
128
- . replace ( / " / g, '\\"' )
129
- . replace ( / ' / g, '"' ) ;
130
-
131
124
process . config = JSON . parse ( config , function ( key , value ) {
132
125
if ( value === 'true' ) return true ;
133
126
if ( value === 'false' ) return false ;
Original file line number Diff line number Diff line change @@ -261,6 +261,11 @@ def JS2C(source, target):
261
261
if '/' in name or '\\ ' in name :
262
262
name = '/' .join (re .split ('/|\\ \\ ' , name )[1 :])
263
263
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 )
264
269
name = name .split ('.' , 1 )[0 ]
265
270
var = name .replace ('-' , '_' ).replace ('/' , '_' )
266
271
key = '%s_key' % var
You can’t perform that action at this time.
0 commit comments