aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_script.cpp
diff options
context:
space:
mode:
authorKostadin Damyanov2015-08-09 12:45:21 +0300
committerKostadin Damyanov2015-08-09 12:45:21 +0300
commitcdf1ac7d58f3dc026cd316a66450771762d74432 (patch)
tree635ab608220b2940674098253efddbca7a69377a /modules/gdscript/gd_script.cpp
parentf5bfd497aab7e24a6f4dc0315e9e9333504067a0 (diff)
parentc2e2f2e0aebf6342e6f18ae5d67b6a825590675a (diff)
downloadgodot-cdf1ac7d58f3dc026cd316a66450771762d74432.tar.gz
godot-cdf1ac7d58f3dc026cd316a66450771762d74432.tar.zst
godot-cdf1ac7d58f3dc026cd316a66450771762d74432.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
-rw-r--r--modules/gdscript/gd_script.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index b6ad7aa71..53ae0c870 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -1977,9 +1977,17 @@ void GDScript::_bind_methods() {
ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo("new"));
+ ObjectTypeDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code);
+
}
+Vector<uint8_t> GDScript::get_as_byte_code() const {
+
+ GDTokenizerBuffer tokenizer;
+ return tokenizer.parse_code_string(source);
+};
+
Error GDScript::load_byte_code(const String& p_path) {
@@ -2556,9 +2564,9 @@ void GDScriptLanguage::init() {
//populate native classes
- List<String> class_list;
+ List<StringName> class_list;
ObjectTypeDB::get_type_list(&class_list);
- for(List<String>::Element *E=class_list.front();E;E=E->next()) {
+ for(List<StringName>::Element *E=class_list.front();E;E=E->next()) {
StringName n = E->get();
String s = String(n);