@@ -820,9 +820,10 @@ void SetPrepareStackTraceCallback(const FunctionCallbackInfo<Value>& args) {
820820 env->set_prepare_stack_trace_callback (args[0 ].As <Function>());
821821}
822822
823- static void EnableSourceMaps (const FunctionCallbackInfo<Value>& args) {
823+ static void SetSourceMapsEnabled (const FunctionCallbackInfo<Value>& args) {
824824 Environment* env = Environment::GetCurrent (args);
825- env->set_source_maps_enabled (true );
825+ CHECK (args[0 ]->IsBoolean ());
826+ env->set_source_maps_enabled (args[0 ].As <Boolean>()->BooleanValue (env->isolate ()));
826827}
827828
828829static void SetEnhanceStackForFatalException (
@@ -858,7 +859,7 @@ static void TriggerUncaughtException(const FunctionCallbackInfo<Value>& args) {
858859
859860void RegisterExternalReferences (ExternalReferenceRegistry* registry) {
860861 registry->Register (SetPrepareStackTraceCallback);
861- registry->Register (EnableSourceMaps );
862+ registry->Register (SetSourceMapsEnabled );
862863 registry->Register (SetEnhanceStackForFatalException);
863864 registry->Register (NoSideEffectsToString);
864865 registry->Register (TriggerUncaughtException);
@@ -871,7 +872,7 @@ void Initialize(Local<Object> target,
871872 Environment* env = Environment::GetCurrent (context);
872873 env->SetMethod (
873874 target, " setPrepareStackTraceCallback" , SetPrepareStackTraceCallback);
874- env->SetMethod (target, " enableSourceMaps " , EnableSourceMaps );
875+ env->SetMethod (target, " setSourceMapsEnabled " , SetSourceMapsEnabled );
875876 env->SetMethod (target,
876877 " setEnhanceStackForFatalException" ,
877878 SetEnhanceStackForFatalException);
0 commit comments