Debian Codegraph @

tests/test_callparam/test_callparam.qml

raw
1 import QtQuick 2.0
2 import io.thp.pyotherside 1.0
3
4 Rectangle {
5 id: page
6 width: 300
7 height: 300
8
9 Python {
10 Component.onCompleted: {
11 // We use call_sync() instead of call() in order
12 // to guarantee the right ordering of Python's output
13 // and the output of the JS engine for the error
14
15 // This should fail with an error:
16 // "Not a parameter list in call to print: 123"
17 call_sync('print', 123);
18
19 // This should work and print "123" on the console
20 call_sync('print', [123]);
21 }
22
23 onError: {
24 console.log('Received error: ' + traceback);
25 }
26 }
27 }