diff --git a/SCsub b/SCsub index b8486b59..aa80b6a1 100644 --- a/SCsub +++ b/SCsub @@ -5,6 +5,7 @@ Import('env') Import('env_modules') env_module = env_modules.Clone() JS_ENGINE = 'quickjs' +TOOLS = env.get('TOOLS'); def open_file(path, mode): if platform.python_version() > '3': @@ -41,7 +42,7 @@ if JS_ENGINE == 'quickjs': env_module.Append(CPPPATH=["quickjs/quickjs"]) # env_module.Append(CXXFLAGS=["-std=c++20"]) # env_module.Append(CCFLAGS=["-std=c++20"]) - if env['tools']: + if TOOLS: env_module.add_source_files(env.modules_sources, 'tools/editor_tools.cpp') env_module.add_source_files(env.modules_sources, 'quickjs/quickjs_builtin_binder.gen.cpp') env_module.add_source_files(env.modules_sources, 'quickjs/*.cpp') @@ -60,7 +61,7 @@ sources = [ 'misc/godot.binding_script.gen.cpp', ] -if env['tools']: +if TOOLS: base_text = '/* THIS FILE IS GENERATED DO NOT EDIT */\n#include "editor_tools.h"\nString JavaScriptPlugin::{} = \n{};' tool_fns = {"tools/godot.d.ts.gen.cpp": ("BUILTIN_DECLARATION_TEXT", dump_text_file_to_cpp("misc/godot.d.ts")), "tools/tsconfig.json.gen.cpp": ("TSCONFIG_CONTENT", dump_text_file_to_cpp("misc/tsconfig.json")), diff --git a/javascript.cpp b/javascript.cpp index 6445358f..411965e3 100644 --- a/javascript.cpp +++ b/javascript.cpp @@ -23,6 +23,10 @@ bool JavaScript::can_instantiate() const { #endif } +StringName JavaScript::get_global_name() const { + return StringName(); +} + StringName JavaScript::get_instance_base_type() const { static StringName empty; ERR_FAIL_NULL_V(javascript_class, empty); diff --git a/javascript.h b/javascript.h index 0c499bdd..1ffbf1a3 100644 --- a/javascript.h +++ b/javascript.h @@ -43,6 +43,7 @@ class JavaScript : public Script { virtual Ref