summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-04-11 09:43:23 +0200
committerGitHub <noreply@github.com>2019-04-11 09:43:23 +0200
commit10c7742df3eed6c0e0d244d3a8646456beb09d49 (patch)
tree18d701bd4e5f9aef971c65e02d8aa0f297827274 /modules/gdscript/gdscript_parser.cpp
parent2feec990e72345e9d86d5e1aaf98b2aee3a74be1 (diff)
parente56f5d5c910f076fd93af71ada7550f441207f45 (diff)
downloadredot-engine-10c7742df3eed6c0e0d244d3a8646456beb09d49.tar.gz
Merge pull request #27876 from vnen/gdscript-no-builtin-name
Don't allow built-in scripts to use class_name
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r--modules/gdscript/gdscript_parser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index ddf880d36c..6ef906b98d 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3500,6 +3500,10 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
_set_error("'class_name' is only valid for the main class namespace.");
return;
}
+ if (self_path.empty()) {
+ _set_error("'class_name' not allowed in built-in scripts.");
+ return;
+ }
if (tokenizer->get_token(1) != GDScriptTokenizer::TK_IDENTIFIER) {
_set_error("'class_name' syntax: 'class_name <UniqueName>'");