Skip to content

Instantly share code, notes, and snippets.

@rapha
Created September 6, 2010 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rapha/566978 to your computer and use it in GitHub Desktop.
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
(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);
}
})();
#!/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())
}})
<html>
<head><title>hello</title></head>
<body>
world
<input name='postcode' type='text' value='Z'/>
</body>
</html>
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