@@ -44,32 +44,34 @@ class EditorExportJavaScript : public EditorExportPlugin {
4444
4545public:
4646 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;
4849 const Ref<EditorExportPreset> &preset = get_export_preset ();
4950
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+ // }
5354
54- if (script_mode == EditorExportPreset::MODE_SCRIPT_TEXT)
55- return ;
55+ // if (script_mode == EditorExportPreset::MODE_SCRIPT_TEXT)
56+ // return;
5657
5758 String extension = p_path.get_extension ();
5859 if (extension != EXT_JSCLASS && extension != EXT_JSMODULE)
5960 return ;
6061
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+ // }
7273 }
74+ virtual String _get_name () const override { return " JavaScript" ; }
7375};
7476
7577#endif
0 commit comments