Created
September 6, 2010 12:22
-
-
Save rapha/566978 to your computer and use it in GitHub Desktop.
using rhino continuations to speed up start-up time of env.js tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var snap = function(filename) { | |
return new Continuation() | |
} | |
var top = {}; | |
load.call(top, 'env.rhino.js'); | |
load.call(top, 'jquery-1.4.2.js'); | |
top.window.location = 'page.html'; | |
top.__context__ = null; | |
var here = snap(); | |
if (here instanceof Continuation) { | |
serialize(here, 'init.state'); | |
} else { | |
here(top); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env rhino -opt -1 | |
var given = function(stateFile) { | |
return function(code) { | |
spawn(function(){ | |
deserialize(stateFile)(code); | |
}); | |
} | |
} | |
var fromTheStart = given('init.state') | |
fromTheStart(function(_) { with(_) { | |
$('input').val('a') | |
print('a'+$('input').val()) | |
}}) | |
fromTheStart(function(_) { with(_) { | |
$('input').val('b') | |
print('b'+$('input').val()) | |
}}) | |
fromTheStart(function(_) { with(_) { | |
$('input').val('c') | |
print('c'+$('input').val()) | |
}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title>hello</title></head> | |
<body> | |
world | |
<input name='postcode' type='text' value='Z'/> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/org/mozilla/javascript/IdFunctionObject.java b/src/org/mozilla/javascript/IdFunctionObject.java | |
index 32d03c9..98c24b4 100644 | |
--- a/src/org/mozilla/javascript/IdFunctionObject.java | |
+++ b/src/org/mozilla/javascript/IdFunctionObject.java | |
@@ -84,7 +84,7 @@ public class IdFunctionObject extends BaseFunction | |
public final boolean hasTag(Object tag) | |
{ | |
- return this.tag == tag; | |
+ return this.tag.equals(tag); | |
} | |
public final int methodId() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment