[Webkit-unassigned] [Bug 142934] New: __defineGetter__/__defineSetter__ should throw exceptions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Mar 21 00:08:35 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=142934

            Bug ID: 142934
           Summary: __defineGetter__/__defineSetter__ should throw
                    exceptions
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: joepeck at webkit.org
                CC: ggaren at apple.com

* SUMMARY
__defineGetter__/__defineSetter__ should throw exceptions.

* TEST
debug("__defineGetter__ and __defineSetter__ should throw exceptions when acting on sealed objects");
var o14 = {a:14};
Object.seal(o14);
shouldThrow("o14.__defineGetter__('a', function(){})");
shouldThrow("o14.__defineGetter__('b', function(){})");
shouldThrow("o14.__defineSetter__('a', function(){})");
shouldThrow("o14.__defineSetter__('b', function(){})");

debug("__defineGetter__ and __defineSetter__ should throw exceptions when acting on frozen objects");
var o15 = {a:15};
Object.freeze(o15);
shouldThrow("o15.__defineGetter__('a', function(){})");
shouldThrow("o15.__defineGetter__('b', function(){})");
shouldThrow("o15.__defineSetter__('a', function(){})");
shouldThrow("o15.__defineSetter__('b', function(){})");

* NOTES
- WebKit fails silently
- Firefox throws exceptions
- Chrome fails silently

I think throwing an exception makes more sense. It at least lets the developer know something went wrong. I don't think there is any specification for these functions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150321/9123f566/attachment-0002.html>


More information about the webkit-unassigned mailing list