@@ -820,9 +820,11 @@ 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 (
827+       args[0 ].As <Boolean>()->BooleanValue (env->isolate ()));
826828}
827829
828830static  void  SetEnhanceStackForFatalException (
@@ -858,7 +860,7 @@ static void TriggerUncaughtException(const FunctionCallbackInfo<Value>& args) {
858860
859861void  RegisterExternalReferences (ExternalReferenceRegistry* registry) {
860862  registry->Register (SetPrepareStackTraceCallback);
861-   registry->Register (EnableSourceMaps );
863+   registry->Register (SetSourceMapsEnabled );
862864  registry->Register (SetEnhanceStackForFatalException);
863865  registry->Register (NoSideEffectsToString);
864866  registry->Register (TriggerUncaughtException);
@@ -871,7 +873,7 @@ void Initialize(Local<Object> target,
871873  Environment* env = Environment::GetCurrent (context);
872874  env->SetMethod (
873875      target, " setPrepareStackTraceCallback"  , SetPrepareStackTraceCallback);
874-   env->SetMethod (target, " enableSourceMaps "  , EnableSourceMaps );
876+   env->SetMethod (target, " setSourceMapsEnabled "  , SetSourceMapsEnabled );
875877  env->SetMethod (target,
876878                 " setEnhanceStackForFatalException"  ,
877879                 SetEnhanceStackForFatalException);
0 commit comments