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) {
109
109
function setupConfig ( _source ) {
110
110
// NativeModule._source
111
111
// used for `process.config`, but not a real module
112
- var config = _source . config ;
112
+ const config = _source . config ;
113
113
delete _source . config ;
114
114
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
-
122
115
process . config = JSON . parse ( config , function ( key , value ) {
123
116
if ( value === 'true' ) return true ;
124
117
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