forked from cory/tildefriends
		
	git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3206 ed5197a5-7fde-0310-b194-c3ffbd925b24
		
			
				
	
	
		
			28 lines
		
	
	
		
			447 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			447 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/bash
 | |
| 
 | |
| cat > test.js << EOF
 | |
| var task = new Task();
 | |
| task.activate();
 | |
| task.execute({name: "child.js", source: File.readFile("child.js")}).then(function() {
 | |
| 	task.getExports().then(function(exports) {
 | |
| 		return exports.add(1, 1);
 | |
| 	}).then(function(sum) {
 | |
| 		if (sum == 2) {
 | |
| 			exit(0);
 | |
| 		} else {
 | |
| 			exit(1);
 | |
| 		}
 | |
| 	});
 | |
| });
 | |
| EOF
 | |
| 
 | |
| cat > child.js << EOF
 | |
| exports = {
 | |
| 	add: function(left, right) {
 | |
| 		return left + right;
 | |
| 	}
 | |
| }
 | |
| EOF
 | |
| 
 | |
| $TILDEFRIENDS test.js
 |