forked from cory/tildefriends
		
	Fixed a segfault I noticed related to require and shutdown.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3292 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		
							
								
								
									
										28
									
								
								tests/11-require
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								tests/11-require
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| cat > required.js << EOF | ||||
| function foo() { | ||||
| 	return 12345; | ||||
| } | ||||
|  | ||||
| exports.foo = foo; | ||||
| EOF | ||||
|  | ||||
| cat > test.js << EOF | ||||
| if (require("required").foo() != 12345) { | ||||
| 	exit(1); | ||||
| } | ||||
| var gotError = false; | ||||
| try { | ||||
| 	require("missing"); | ||||
| } catch (error) { | ||||
| 	print("nope"); | ||||
| 	gotError = true; | ||||
| } | ||||
| if (!gotError) { | ||||
| 	exit(2); | ||||
| } | ||||
| exit(0); | ||||
| EOF | ||||
|  | ||||
| $TILDEFRIENDS test.js | ||||
		Reference in New Issue
	
	Block a user