sandboxos => tildefriends
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3157 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
26
tests/05-promise-remote-throw
Executable file
26
tests/05-promise-remote-throw
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
cat > test.js << EOF
|
||||
var task = new Task();
|
||||
task.activate();
|
||||
task.execute("child.js").then(function() {
|
||||
task.getExports().then(function(exports) {
|
||||
return exports.add(1, 1);
|
||||
}).then(function(sum) {
|
||||
exit(1);
|
||||
}).catch(function(error) {
|
||||
print("Caught: " + error.message);
|
||||
exit(0);
|
||||
});
|
||||
});
|
||||
EOF
|
||||
|
||||
cat > child.js << EOF
|
||||
exports = {
|
||||
add: function(left, right) {
|
||||
throw new Error("fail");
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
$SANDBOXOS test.js
|
Reference in New Issue
Block a user