Skip to content

Instantly share code, notes, and snippets.

@Synesso
Created September 18, 2009 05:45
Show Gist options
  • Save Synesso/188901 to your computer and use it in GitHub Desktop.
Save Synesso/188901 to your computer and use it in GitHub Desktop.
$ java -jar js.jar
Rhino 1.7 release 2 2009 03 22
js> load ("mootools-1.2.3-core-server.js");
js> var Cat = new Class({
> initialize: function(name){
> this.name = name;
> }
> });
js> var kitty = new Cat("Kitty");
js> print(kitty.name);
undefined
js> Cat.initialize
js> Cat.initialize();
js: "<stdin>", line 11: uncaught JavaScript runtime exception: TypeError: Cannot find function initialize in object
function () {
Object.reset(this);
if (newClass._prototyping) {
return this;
}
this._current = $empty;
var value = (this.initialize) ? this.initialize.apply(this, arguments) : this;
delete this._current;
delete this.caller;
return value;
}
.
at <stdin>:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment