Skip to content

Commit

Permalink
GDScript: Don't allow built-in scripts to use class_name
Browse files Browse the repository at this point in the history
  • Loading branch information
vnen committed Apr 10, 2019
1 parent 5823b5d commit e56f5d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/gdscript/gdscript_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>'");
Expand Down

0 comments on commit e56f5d5

Please sign in to comment.