@@ -44,32 +44,34 @@ class EditorExportJavaScript : public EditorExportPlugin {
44
44
45
45
public:
46
46
virtual void _export_file (const String &p_path, const String &p_type, const HashSet<String> &p_features) override {
47
- int script_mode = EditorExportPreset::MODE_SCRIPT_COMPILED;
47
+ String script_key;
48
+ // int script_mode = EditorExportPreset::MODE_SCRIPT_COMPILED;
48
49
const Ref<EditorExportPreset> &preset = get_export_preset ();
49
50
50
- if (preset.is_valid ()) {
51
- script_mode = preset->get_script_export_mode ( );
52
- }
51
+ // if (preset.is_valid()) {
52
+ // script_mode = preset->get_file_export_mode(p_path );
53
+ // }
53
54
54
- if (script_mode == EditorExportPreset::MODE_SCRIPT_TEXT)
55
- return ;
55
+ // if (script_mode == EditorExportPreset::MODE_SCRIPT_TEXT)
56
+ // return;
56
57
57
58
String extension = p_path.get_extension ();
58
59
if (extension != EXT_JSCLASS && extension != EXT_JSMODULE)
59
60
return ;
60
61
61
- if (script_mode == EditorExportPreset::ScriptExportMode ::MODE_SCRIPT_COMPILED) {
62
- #if 0 // Disable compile to bytecode as it is not battle tested on all platform
63
- Error err;
64
- String code = FileAccess::get_file_as_string(p_path, &err);
65
- ERR_FAIL_COND(err != OK);
66
-
67
- Vector<uint8_t> file;
68
- ERR_FAIL_COND(JavaScriptLanguage::get_singleton()->get_main_binder()->compile_to_bytecode(code, p_path, file) != OK);
69
- add_file(p_path.get_basename() + "." + extension + "b", file, true);
70
- #endif
71
- }
62
+ // if (script_mode == EditorExportPreset::FileExportMode ::MODE_SCRIPT_COMPILED) {
63
+ // #if 0 // Disable compile to bytecode as it is not battle tested on all platform
64
+ // Error err;
65
+ // String code = FileAccess::get_file_as_string(p_path, &err);
66
+ // ERR_FAIL_COND(err != OK);
67
+
68
+ // Vector<uint8_t> file;
69
+ // ERR_FAIL_COND(JavaScriptLanguage::get_singleton()->get_main_binder()->compile_to_bytecode(code, p_path, file) != OK);
70
+ // add_file(p_path.get_basename() + "." + extension + "b", file, true);
71
+ // #endif
72
+ // }
72
73
}
74
+ virtual String _get_name () const override { return " JavaScript" ; }
73
75
};
74
76
75
77
#endif
0 commit comments