Option "selectedness" needs tests
Reported by nickg | March 15th, 2010 @ 11:56 AM
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 March 21st, 2010 @ 12:19 PM
- State changed from new to open
- Assigned user set to nickg
-
nickg March 27th, 2010 @ 07:15 AM
part 1 is committed.
Unfortunately the logic to determine "selectedness" looks fishy, so a lot more unit tests are needed.
--nickg
-
nickg April 2nd, 2010 @ 12:22 PM
- Title changed from Option is not defined to Option "selectedness" needs tests
-
nickg April 25th, 2010 @ 07:20 AM
- 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