summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_function.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * Keep GDScript functions in stack while yieldingGeorge Marques2019-05-141-6/+39
| | | | | | | | | | | | | | | | | | | | This prevents GDScript functions from leaving the stack too soon when they are resuming from yield, allowing the ones expecting it to finish to know the caller. Helps debugging cases when you use: `yield(function_which_yields(), "completed")` since now it shows the call that resumed that function.
* | fix some crashesFurkan Türkal2019-07-011-2/+2
| |
* | GDScript: Improve error on Object to Object invalid argument callsRémi Verschelde2019-06-181-27/+35
|/ | | | Fixes #27804.
* Revert "Forbid implicit type conversion in GDScript"Rémi Verschelde2019-03-041-3/+8
|
* GDScript: Forbid implicit type conversionGeorge Marques2019-03-031-8/+3
| | | | | Since types are not present in release builds, this could cause issues where a variable does not have the exact defined type.
* Allow parameters passed to GDScript functions to be nulledBojidar Marinov2019-03-031-4/+9
| | | | | Previous version resulted in confusing (but actually right) errors about converting "from Object to Object", since CallError does not include information about the actual types involved.
* Fix wrong error messages for invalid arguments when calling functions ↵Bojidar Marinov2019-01-311-1/+1
| | | | | | through call Fixes #25505
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Merge pull request #23959 from RandomShaper/fix-dangling-script-fixRémi Verschelde2018-11-261-24/+9
|\ | | | | Fix dangling script fix
| * Fix crash on signal/resume to dangling targetPedro J. Estébanez2018-11-251-27/+17
| |
| * Revert "Fix crash on signal/resume to dangling target"Pedro J. Estébanez2018-11-241-27/+22
| | | | | | | | This reverts commit 54bdc1e1f6a7fb85a5b193c9b8ecf0dcf06949e6.
* | Allow primitives to be compared to Object types with `is`George Marques2018-11-171-30/+27
|/
* Fix crash on signal/resume to dangling targetPedro J. Estébanez2018-10-171-22/+27
| | | | Fixes #22443.
* Fix compiler warnings in GDScript moduleGeorge Marques2018-10-061-10/+19
|
* Revert cause of #22794Mariusz Chwalba2018-10-061-5/+5
|
* Fix warnings on release builds (not DEBUG_ENABLED)Rémi Verschelde2018-10-031-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following Clang 5 warnings: ``` modules/bmp/image_loader_bmp.cpp:46:60: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] modules/bmp/image_loader_bmp.cpp:48:61: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] drivers/png/image_loader_png.cpp:231:20: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare] scene/gui/graph_edit.cpp:1045:8: warning: comparison of constant 0 with expression of type 'bool' is always false [-Wtautological-constant-out-of-range-compare] core/class_db.cpp:812:13: warning: unused variable 'check' [-Wunused-variable] core/io/file_access_pack.cpp:172:11: warning: unused variable 'ver_rev' [-Wunused-variable] core/math/bsp_tree.cpp:195:13: warning: unused variable 'plane' [-Wunused-variable] core/math/bsp_tree.cpp:168:6: warning: unused variable 'plane_count' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:685:10: warning: unused variable 'ok' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:706:10: warning: unused variable 'ok' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:755:19: warning: unused variable 'var_type' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:1306:12: warning: unused variable 'err' [-Wunused-variable] modules/gdscript/gdscript_function.cpp:158:15: warning: unused function '_get_var_type' [-Wunused-function] modules/gdscript/gdscript_parser.cpp:750:20: warning: unused variable 'lv' [-Wunused-variable] modules/gdscript/gdscript_parser.cpp:59:15: warning: unused function '_find_function_name' [-Wunused-function] scene/main/node.cpp:2489:13: warning: unused function '_Node_debug_sn' [-Wunused-function] ```
* Fix invalid comparison warnings: [-Wbool-compare] and [-Wenum-compare]Rémi Verschelde2018-09-271-1/+1
| | | | | | | | | | | | | Fixes the following GCC 5 warnings and actual bugs: ``` drivers/unix/net_socket_posix.cpp:562:28: warning: comparison between 'enum IP::Type' and 'enum NetSocket::Type' [-Wenum-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: comparison of constant '17' with boolean expression is always true [-Wbool-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/gdscript/gdscript_parser.cpp:5082:58: warning: comparison of constant '6' with boolean expression is always false [-Wbool-compare] modules/gdscript/gdscript_parser.cpp:5082:58: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/mbedtls/stream_peer_mbed_tls.cpp:286:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] modules/mbedtls/stream_peer_mbed_tls.cpp:313:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] ```
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-1/+1
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* GDScript: Allow `is` operator to test built-in typesGeorge Marques2018-08-261-0/+16
|
* GDScript: Fix type detection on Object typed assignGeorge Marques2018-07-251-3/+14
| | | | | Also make typed assigns a debug-only thing, so release builds are more lenient on errors.
* GDScript: Allow strict conversion when assigning typed variablesGeorge Marques2018-07-251-5/+10
|
* GDScript: Fix returned value of get_default_argument_count()George Marques2018-07-251-1/+1
|
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* Add typed instructions to GDScriptGeorge Marques2018-07-201-3/+220
| | | | | | | - Typed assignment (built-in, native, and script). - Cast (built-in conversion; native and script checks). - Check type of functions arguments on call. - Check type of members on set.
* Add static type checks in the parserGeorge Marques2018-07-201-0/+9
| | | | | | | | | | | | - Resolve types for all identifiers. - Error when identifier is not found. - Match return type and error when not returning a value when it should. - Check unreachable code (code after sure return). - Match argument count and types for function calls. - Determine if return type of function call matches the assignment. - Do static type check with match statement when possible. - Use type hints to determine export type. - Check compatibility between type hint and explicit export type.
* Fix memory leak in GDScript during infinnity loops with yieldsYasha Borevich2018-06-281-10/+10
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-291-1/+1
|
* Revert "RPCMode refactor, more sync modes"Max Hilbrunner2018-05-291-1/+1
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-261-1/+1
|
* Merge pull request #18545 from vnen/editor-autoloadJuan Linietsky2018-05-141-0/+15
|\ | | | | Enable autoload in editor
| * Enable autoload in editorGeorge Marques2018-05-011-0/+15
| | | | | | | | | | | | - Tool scripts will be executed and can be accessed by plugins. - Other script languages can implement add/remove_named_global_constant to make use of this functionality.
* | Fix a crash when trying to run Godot debugger on a release build.Brian Richardson2018-05-011-1/+1
|/ | | | The GDScriptLanguage::enter_function is wrapped in #ifdef DEBUG but the exit_function is not, resulting in a stack underflow error.
* Change ".." punctuation for "..." in editor strings (#16507)Hugo Locurcio2018-04-221-1/+1
|
* completed-signal is emitted by all GDScriptFunctionStates of a coroutine ↵Lars Kokemohr2018-03-141-4/+16
| | | | now, allowing to yield for completion of a function with more than one yield inside.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Merge pull request #15089 from poke1024/funcref-warnRémi Verschelde2018-01-031-1/+1
|\ | | | | Warn about funcref creation
| * Warn about funcref creationBernhard Liebl2017-12-261-1/+1
| |
* | Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Cleanup some #if 0'd codeRémi Verschelde2017-12-171-0/+2
|
* Style: Re-apply clang-format over recent invalid additionsRémi Verschelde2017-12-101-2/+2
|
* Fixed is_playing funtion (was reporting wrong), closes #13928Juan Linietsky2017-12-071-2/+2
| | | | Made error reporting to opcode_set in gdscript a bit clearer
* Style: Apply new clang-format 5.0 style to all filesRémi Verschelde2017-12-071-3/+3
|
* GDScript: Refactor "GD" class prefix to "GDScript"Rémi Verschelde2017-11-161-0/+1628