Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Option "selectedness" needs tests

#112

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;

Reported by nickg · March 15th, 2010 @ 11:56 AM

State: resolved
Milestone: none
Assigned to: nickg nickg

Activity

  1. nickg
    nickg
    • State changed from new to open
    • Assigned user set to nickg

    March 21st, 2010 @ 12:19 PM

  2. nickg
    nickg

    part 1 is committed.

    Unfortunately the logic to determine "selectedness" looks fishy, so a lot more unit tests are needed.

    --nickg

    March 27th, 2010 @ 07:15 AM

  3. nickg
    nickg
    • Title changed from Option is not defined to Option "selectedness" needs tests

    April 2nd, 2010 @ 12:22 PM

  4. nickg
    nickg
    • State changed from open to resolved

    To git@github.com:thatcher/env-js.git
    15ce602..b9d78ef master -> master

    resolving

    April 25th, 2010 @ 07:20 AM

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.