Browse Source

Merge pull request #94527 from HolonProduction/who-needs-source-code

Add note about `Script.has_source_code` and GDScript binary tokenization
Rémi Verschelde 1 year ago
parent
commit
566adc6025
1 changed files with 1 additions and 0 deletions
  1. 1 0
      doc/classes/Script.xml

+ 1 - 0
doc/classes/Script.xml

@@ -93,6 +93,7 @@
 			<return type="bool" />
 			<return type="bool" />
 			<description>
 			<description>
 				Returns [code]true[/code] if the script contains non-empty source code.
 				Returns [code]true[/code] if the script contains non-empty source code.
+				[b]Note:[/b] If a script does not have source code, this does not mean that it is invalid or unusable. For example, a [GDScript] that was exported with binary tokenization has no source code, but still behaves as expected and could be instantiated. This can be checked with [method can_instantiate].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="instance_has" qualifiers="const">
 		<method name="instance_has" qualifiers="const">