diff --git a/runtime/builtins.cpp b/runtime/builtins.cpp index 35cf7ec61c9a3fd703897e30a676e2118ea18860..74e82f9babee986141aa9405a87900ce61d12501 100644 --- a/runtime/builtins.cpp +++ b/runtime/builtins.cpp @@ -306,8 +306,7 @@ void Builtins::Initialize(const JSHandle &env, JSThread *thread) InitializePromiseJob(env); InitializeFinalizationRegistry(env, obj_func_dynclass); - JSRuntimeOptions options = JSRuntimeOptions::Cast(vm_->GetOptions()); - std::string icu_path = options.GetIcuDataPath(); + std::string icu_path = vm_->GetJSOptions().GetIcuDataPath(); if (icu_path == "default") { SetIcuDirectory(); } else { @@ -366,11 +365,12 @@ void Builtins::InitializeGlobalObject(const JSHandle &env, const JSHa SetFunction(env, global_object, "stopRuntimeStat", Global::StopRuntimeStat, 0); #endif - JSRuntimeOptions options = JSRuntimeOptions::Cast(vm_->GetOptions()); - if (options.IsEnableArkTools()) { + // TODO(ivagin): Remove ArkTools? + if (vm_->GetJSOptions().IsEnableArkTools()) { JSHandle ark_tools(InitializeArkTools(env)); SetConstantObject(global_object, "ArkTools", ark_tools); } + #ifndef PANDA_PRODUCT_BUILD JSHandle runtime_testing(InitializeRuntimeTesting(env)); SetConstantObject(global_object, "RuntimeTesting", runtime_testing); diff --git a/runtime/ecma_language_context.cpp b/runtime/ecma_language_context.cpp index b962ae834617885481f8e7368bdd06d4ce45f968..3cc6d5a606df4d6f6a48773bd0fb51c6e55b6922 100644 --- a/runtime/ecma_language_context.cpp +++ b/runtime/ecma_language_context.cpp @@ -59,7 +59,7 @@ std::pair EcmaLanguageContext::GetCatchMethodAndOffset(Metho PandaVM *EcmaLanguageContext::CreateVM(Runtime *runtime, const RuntimeOptions &options) const { - auto ret = EcmaVM::Create(runtime, ecmascript::JSRuntimeOptions::Cast(options)); + auto ret = EcmaVM::Create(runtime, ecmascript::JSRuntimeOptions(options)); if (ret) { return ret.Value(); } diff --git a/runtime/js_runtime_options.h b/runtime/js_runtime_options.h index 4cc7e2d9775a763128e2afeb34032cb8c75ac650..8eb470b4aec2f4d4e4e491f49c4272796647760f 100644 --- a/runtime/js_runtime_options.h +++ b/runtime/js_runtime_options.h @@ -34,11 +34,6 @@ public: DEFAULT_COPY_SEMANTIC(JSRuntimeOptions); DEFAULT_MOVE_SEMANTIC(JSRuntimeOptions); - inline static JSRuntimeOptions Cast(RuntimeOptions runtime_options) - { - return static_cast(std::move(runtime_options)); - } - void AddOptions(PandArgParser *parser) { RuntimeOptions::AddOptions(parser);