From 9ddebc0c22866d6b7a7ff3fa64b67cc86c8664da Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Mon, 27 Jun 2022 13:10:04 -0700 Subject: Add a const call mode to Object, Variant and Script. For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script). This mode ensures only const functions can be called, making it safe to use from the editor. Co-Authored-By: reduz --- editor/plugins/script_text_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editor/plugins/script_text_editor.cpp') diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 05c707c065..7d4ffd1a25 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1196,7 +1196,7 @@ void ScriptTextEditor::_edit_option(int p_op) { String whitespace = line.substr(0, line.size() - line.strip_edges(true, false).size()); //extract the whitespace at the beginning if (expression.parse(line) == OK) { - Variant result = expression.execute(Array(), Variant(), false); + Variant result = expression.execute(Array(), Variant(), false, true); if (expression.get_error_text().is_empty()) { results.push_back(whitespace + result.get_construct_string()); } else { -- cgit v1.2.3