Bug 152765 - [ES6] Boolean, Number, Map, RegExp, and Set should be subclassable
Summary: [ES6] Boolean, Number, Map, RegExp, and Set should be subclassable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords:
Depends on:
Blocks: 142591
  Show dependency treegraph
 
Reported: 2016-01-05 17:08 PST by Keith Miller
Modified: 2016-01-15 10:40 PST (History)
4 users (show)

See Also:


Attachments
Patch (13.02 KB, patch)
2016-01-05 20:45 PST, Keith Miller
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-01-05 17:08:15 PST
[ES6] Boolean, Number, Map, RegExp, and Set should be subclassable
Comment 1 Keith Miller 2016-01-05 20:45:27 PST
Created attachment 268351 [details]
Patch
Comment 2 Keith Miller 2016-01-06 10:00:16 PST
Comment on attachment 268351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=268351&action=review

> Source/JavaScriptCore/tests/es6.yaml:1090
> +  cmd: runES6 :normal

For some reason the other subclassing tests were already marked as passing. I'm not sure why.
Comment 3 Michael Saboff 2016-01-06 10:11:01 PST
Comment on attachment 268351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=268351&action=review

r=me with suggested changes.

> Source/JavaScriptCore/runtime/BooleanConstructor.cpp:3
> - *  Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
> + *  Copyright (C) 2003-2016 Apple Inc. All rights reserved.

I think you just want to add ", 2016" and not change it to a year range.

> Source/JavaScriptCore/runtime/BooleanConstructor.h:3
> - *  Copyright (C) 2008 Apple Inc. All rights reserved.
> + *  Copyright (C) 2008-2016 Apple Inc. All rights reserved.

ditto

> Source/JavaScriptCore/runtime/MapConstructor.cpp:2
> - * Copyright (C) 2013 Apple Inc. All rights reserved.
> + * Copyright (C) 2013-2016 Apple Inc. All rights reserved.

ditto

> Source/JavaScriptCore/runtime/NumberConstructor.cpp:3
> - *  Copyright (C) 2007, 2008, 2011, 2015 Apple Inc. All rights reserved.
> + *  Copyright (C) 2007-2016 Apple Inc. All rights reserved.

ditto

> Source/JavaScriptCore/runtime/RegExpConstructor.cpp:3
> - *  Copyright (C) 2003, 2007, 2008 Apple Inc. All Rights Reserved.
> + *  Copyright (C) 2003-2016 Apple Inc. All Rights Reserved.

ditto

> Source/JavaScriptCore/runtime/SetConstructor.cpp:2
> - * Copyright (C) 2013 Apple Inc. All rights reserved.
> + * Copyright (C) 2013-2016 Apple Inc. All rights reserved.

ditto
Comment 4 Keith Miller 2016-01-06 10:20:04 PST
Comment on attachment 268351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=268351&action=review

>> Source/JavaScriptCore/runtime/BooleanConstructor.cpp:3
>> + *  Copyright (C) 2003-2016 Apple Inc. All rights reserved.
> 
> I think you just want to add ", 2016" and not change it to a year range.

Fixed.

>> Source/JavaScriptCore/runtime/BooleanConstructor.h:3
>> + *  Copyright (C) 2008-2016 Apple Inc. All rights reserved.
> 
> ditto

Fixed.

>> Source/JavaScriptCore/runtime/MapConstructor.cpp:2
>> + * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
> 
> ditto

Fixed.

>> Source/JavaScriptCore/runtime/NumberConstructor.cpp:3
>> + *  Copyright (C) 2007-2016 Apple Inc. All rights reserved.
> 
> ditto

Fixed.

>> Source/JavaScriptCore/runtime/RegExpConstructor.cpp:3
>> + *  Copyright (C) 2003-2016 Apple Inc. All Rights Reserved.
> 
> ditto

Fixed.

>> Source/JavaScriptCore/runtime/SetConstructor.cpp:2
>> + * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
> 
> ditto

Fixed.
Comment 5 Keith Miller 2016-01-06 10:25:29 PST
Committed r194643: <http://trac.webkit.org/changeset/194643>
Comment 6 Darin Adler 2016-01-15 10:29:40 PST
Comment on attachment 268351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=268351&action=review

> Source/JavaScriptCore/runtime/BooleanConstructor.cpp:53
> +    JSValue prototype = JSValue();

This is the same thing as:

    JSValue prototype;

Just more wordy. Would be nice to clean that up.

> Source/JavaScriptCore/runtime/MapConstructor.cpp:56
> +    JSValue prototype = JSValue();

Ditto.

> Source/JavaScriptCore/runtime/NumberConstructor.cpp:85
> +    JSValue prototype = JSValue();

Ditto.

> Source/JavaScriptCore/runtime/SetConstructor.cpp:57
> +    JSValue prototype = JSValue();

Ditto.
Comment 7 Keith Miller 2016-01-15 10:40:58 PST
Comment on attachment 268351 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=268351&action=review

>> Source/JavaScriptCore/runtime/BooleanConstructor.cpp:53
>> +    JSValue prototype = JSValue();
> 
> This is the same thing as:
> 
>     JSValue prototype;
> 
> Just more wordy. Would be nice to clean that up.

I actually moved all the new.target.prototype stuff into a helper function in <http://trac.webkit.org/changeset/194863>. So it's already gone but I will look through some of my other patches and see if I put "JSValue prototype = JSValue();" anywhere else.