Suddenly an error message

Bugs will be moved here once resolved.

Post » Mon Dec 17, 2012 10:54 pm

Can someone tell me why?

assertion failure: Calling expvalue.set_string without string type
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Dec 18, 2012 12:35 am

How to report bug

Without more context, or an eye on your code, no way to say why.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,786

Post » Tue Dec 18, 2012 5:27 am

@Kyatric I can't post a capx as it's my whole game ready to be published on the app store. It happened suddenly, for no apparent reason and happens only on a specific layout.
It would be useful to know what kind of error it is instead of this popup that doesn't really help me.

This is the whole thing: http://i.imgur.com/6a64I.png

@Ashley any idea where the problem could be?0plus12012-12-18 05:28:10
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Dec 18, 2012 8:03 am

The error is coming from the calljs plugin, hence cjs_plugin.js.

The ReadExecutionReturn expression is not returning a string.

I can replicate the error with two actions:
CallJS| execute "0"
Text | set text to CallJS.ReadExecutionReturn

It's not a fatal since "0" is returned just fine. The assertion failure is also triggered when calling ReadExecutionReturn if js code with syntax errors is run.

To eliminate the assert edit \CallJS\runtime.js and find ReadExecutionReturn which should look like this:
[code]     exps.ReadExecutionReturn = function (ret)     
     {
          ret.set_string(this.returnValue);
     };[/code]
and change it to this:
[code]     exps.ReadExecutionReturn = function (ret)     
     {
          ret.set_string(String(this.returnValue));
     };[/code]
B
79
S
24
G
52
Posts: 4,724
Reputation: 39,711

Post » Tue Dec 18, 2012 12:48 pm

@R0J0hound thank you, you are amazing. It appears that something changed in Chrome that returns this error, tomorrow I check everything and I'll let you know if I find out something. Meanwhile thanks.
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Dec 18, 2012 3:44 pm

It's a bug in the plugin. You are not allowed to call ret.set_string() with a non-string type - it will break the runtime. So set_string enforces this and shows that error if you pass it something which isn't a string. It's the plugin's responsibility to check the variable type and ensure it's always a string. (Just returning an empty string if it's not a string type is an easy way to handle it, for example)

Tip: if you get an error like that, in Chrome's dev tools open preview_prelude.js and put a breakpoint in assert2 after the "if (!cnd)" line (meaning the assertion has failed). Then just before getting that error dialog Chrome will break in the debugger and you'll have the full call stack to browse and see what went wrong and what the variables are at the time of the call, etc.

Closing as it's a third party plugin bug.
Scirra Founder
B
358
S
214
G
72
Posts: 22,946
Reputation: 178,333


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 6 guests