This repository was archived by the owner on Jul 3, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7878 if ( parsed . runtime ) {
7979 if ( typeof parsed . runtime === 'string' ) {
8080 return parsed . runtime ;
81- } else if ( typeof parsed . runtime === 'object' ) {
82- if ( typeof parsed . runtime . main === 'string' ) {
83- return parsed . runtime . main ;
84- }
85- } else {
86- throwError ( new Error ( `package.json '${ packageJsonFile } ' runtime (or runtime.main) field value is invalid` ) ) ;
8781 }
82+ throwError ( new Error ( `package.json '${ packageJsonFile } ' runtime (or runtime.main) field value is invalid` ) ) ;
8883 }
8984
9085 return parsed . main || 'index.js' ;
Original file line number Diff line number Diff line change @@ -72,18 +72,18 @@ class Engines {
7272
7373 v8::V8::SetEntropySource (EntropySource);
7474
75- InitrdFile pkg_json = GLOBAL_initrd ()->Get (" /package .json" );
76- if (!pkg_json .IsEmpty ()) {
77- const char * pkg_json_cont = (const char *)pkg_json .Data ();
75+ InitrdFile runtime_json = GLOBAL_initrd ()->Get (" /runtime .json" );
76+ if (!runtime_json .IsEmpty ()) {
77+ const char * runtime_json_cont = (const char *)runtime_json .Data ();
7878
7979 std::string err;
80- json11::Json root = json11::Json::parse (pkg_json_cont , err);
80+ json11::Json root = json11::Json::parse (runtime_json_cont , err);
8181 if (err.empty ()) {
82- json11::Json runtime = root[" runtime " ];
83- if (!runtime .is_null () && runtime .is_object ()) {
84- json11::Json v8flags = runtime[ " v8flags " ];
85- if (!v8flags .is_null () && v8flags .is_string ()) {
86- const char * flags_str = v8flags .string_value ().c_str ();
82+ json11::Json v8 = root[" v8 " ];
83+ if (!v8 .is_null () && v8 .is_object ()) {
84+ json11::Json flags = v8[ " flags " ];
85+ if (!flags .is_null () && flags .is_string ()) {
86+ const char * flags_str = flags .string_value ().c_str ();
8787 v8::V8::SetFlagsFromString (flags_str, strlen (flags_str));
8888 }
8989 }
You can’t perform that action at this time.
0 commit comments