Option "selectedness" needs tests
Reported by nickg | 2010-03-15 11:56:23 UTC
Like "Image", "Option" is the other weirdo in the DOM that has a constructor.
$ ./tester.sh
Rhino 1.7 release 2 2009 03 22
js> Option
js: "<stdin>", line 2: uncaught JavaScript runtime exception: ReferenceError: "Option" is not defined.
at <stdin>:2
In my original envjs-like thing I did something like the following. I don't this will work the same in envjs, but it gives an idea of the solution.
// Can free form create Option elements
// who knew!
Option = function(name,value) {
var tmp= window.document.createElement('option');
this._dom = tmp._dom;
this.label = String(name);
if (value) {
this.value = String(value);
this.text = String(value);
}
//print("MADE OPTION OF " + name + ", " + value);
this.__init();
}
Option.prototype = HTMLOptionElement.prototype;
Comments and changes to this ticket
-

nickg 2010-03-21 12:19:41 UTC
- State changed from new to open
- Assigned user set to nickg
-

nickg 2010-03-27 07:15:57 UTC
part 1 is committed.
Unfortunately the logic to determine "selectedness" looks fishy, so a lot more unit tests are needed.
--nickg
-

nickg 2010-04-02 12:22:46 UTC
- Title changed from Option is not defined to Option "selectedness" needs tests
-

nickg 2010-04-25 07:20:12 UTC
- State changed from open to resolved
To git@github.com:thatcher/env-js.git
15ce602..b9d78ef master -> masterresolving
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
a javascript browser environment