The following NewtonScript code demonstrates the problem:
x := { test: func() Throw('|evt.ex.msg|, "This is my message") };
print("try x:test()\n");
try x:test() onexception |evt.ex| do Print("Caught" && CurrentException().message && "\n");
print("try Perform 'test\n");
try Perform(x, 'test, []) onexception |evt.ex| do Print("Caught" && CurrentException().message && "\n");
print("Finished!\n");
When ran under NEWT/0, the output is:
try x:test()
Caught
try Perform 'test
Finished!
Note: No exception was caught during Perform(x, 'test, [])
Under WallyScript/NewtonScript 1.x:
Welcome to WallyScript!
0 > x := { test: func() Throw('|evt.ex.msg|, "This is my message") };
#44139D1 {test: <CodeBlock, 0 args #4413999>}
0 > try x:test() onexception |evt.ex| do Print("Caught" && CurrentException().message && "\n");
"Caught This is my message
"
#2 NIL
0 > try Perform(x, 'test, []) onexception |evt.ex| do Print("Caught" && CurrentException().message && "\n");
Stack trace:
0 : #44139D1.test : 4
Receiver: (vars.x)
1 : (functions.Perform)
Receiver: (vars)
2 : (#4414679) <CodeBlock, 0 args #4414679> : 11
Receiver: (vars)
"Caught This is my message
"
#2 NIL
0 >
The following NewtonScript code demonstrates the problem:
When ran under NEWT/0, the output is:
Note: No exception was caught during Perform(x, 'test, [])
Under WallyScript/NewtonScript 1.x: