Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit af845fc

Browse filesBrowse files
Merge pull request #5530 from runrevmark/bugfix-19474
[[ Bug 19474 ]] Make sure unnamed objects use id form
2 parents d76b423 + 7e45780 commit af845fc
Copy full SHA for af845fc

File tree

Expand file treeCollapse file tree

3 files changed

+43
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+43
-1
lines changed

‎engine/src/object.cpp

Copy file name to clipboardExpand all lines: engine/src/object.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2431,7 +2431,7 @@ bool MCObject::getnameproperty(Properties which, uint32_t p_part_id, MCValueRef&
24312431
// but *only* for this control (continue with names the rest of the way).
24322432
Properties t_which_requested;
24332433
t_which_requested = which;
2434-
if (which == P_LONG_NAME && isunnamed())
2434+
if ((which == P_LONG_NAME || which == P_LONG_NAME_NO_FILENAME) && isunnamed())
24352435
which = P_LONG_ID;
24362436
if (parent)
24372437
{

‎tests/lcs/core/engine/_extension.lcb

Copy file name to clipboardExpand all lines: tests/lcs/core/engine/_extension.lcb
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
library com.livecode.lcs_tests.core.extension
22

3+
use com.livecode.engine
34
use com.livecode.lcs_tests.core.extension.support
45

56
public handler TestExtensionBridgeNames_ExecuteScript()
@@ -68,4 +69,16 @@ public handler TestExtensionLog_Array()
6869
log {"a": 1}
6970
end handler
7071

72+
public handler TestExtensionLog_ScriptObject()
73+
resolve script object "button 1"
74+
log the result
75+
end handler
76+
77+
public handler TestExtensionLog_DeletedScriptObject()
78+
variable tScriptObject as ScriptObject
79+
resolve script object "button 1" into tScriptObject
80+
execute script "delete button 1"
81+
log tScriptObject
82+
end handler
83+
7184
end library

‎tests/lcs/core/engine/extension.livecodescript

Copy file name to clipboardExpand all lines: tests/lcs/core/engine/extension.livecodescript
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,32 @@ on TestExtensionLogString
241241
wait for 0 with messages
242242
TestAssert "extension log string", sLastLog is quote & "log" & quote
243243
end TestExtensionLogString
244+
245+
on TestExtensionLogScriptObject
246+
// resolve script object "button 1"
247+
// log the result
248+
create button
249+
get TestExtensionLog_ScriptObject()
250+
wait for 0 with messages
251+
TestDiagnostic sLastLog
252+
TestAssert "extension log unnamed scriptobject", \
253+
sLastLog is format("<script object button id %d of card id %d of stack %s>", \
254+
the id of button 1, \
255+
the id of this card, \
256+
quote & the short name of this stack & quote)
257+
258+
set the name of button 1 to "foo"
259+
get TestExtensionLog_ScriptObject()
260+
wait for 0 with messages
261+
TestDiagnostic sLastLog
262+
TestAssert "extension log named scriptobject", \
263+
sLastLog is format("<script object button %s of card id %d of stack %s>", \
264+
quote & the short name of button 1 & quote, \
265+
the id of this card, \
266+
quote & the short name of this stack & quote)
267+
268+
get TestExtensionLog_DeletedScriptObject()
269+
wait for 0 with messages
270+
TestDiagnostic sLastLog
271+
TestAssert "extension log deleted scriptobject", sLastLog is "<deleted script object>"
272+
end TestExtensionLogScriptObject

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.