WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 170888
test262: test262/test/built-ins/isNaN/toprimitive-not-callable-throws.js
https://bugs.webkit.org/show_bug.cgi?id=170888
Summary
test262: test262/test/built-ins/isNaN/toprimitive-not-callable-throws.js
Joseph Pecoraro
Reported
2017-04-16 12:24:30 PDT
test262/test/built-ins/isNaN/toprimitive-not-callable-throws.js Test: isNaN( {[Symbol.toPrimitive]: 1} ) Expected: Throw TypeError, Symbol.toPrimitive must be a function, undefined, or null Actual: true Notes: - Firefox: TypeError: can't convert v to number: its [Symbol.toPrimitive] property is not a function - Chrome: TypeError: number is not a function Spec:
https://tc39.github.io/ecma262/#sec-toprimitive
7.1.1 ToPrimitive ( input [ , PreferredType ] )
> 1. Assert: input is an ECMAScript language value. > 2. If Type(input) is Object, then > a. If PreferredType was not passed, let hint be "default". > b. Else if PreferredType is hint String, let hint be "string". > c. Else PreferredType is hint Number, let hint be "number". > d. Let exoticToPrim be ? GetMethod(input, @@toPrimitive). > e. If exoticToPrim is not undefined, then > ...
https://tc39.github.io/ecma262/#sec-getmethod
7.3.9 GetMethod ( V, P )
> 1. Assert: IsPropertyKey(P) is true. > 2. Let func be ? GetV(V, P). > 3. If func is either undefined or null, return undefined. > 4. If IsCallable(func) is false, throw a TypeError exception. > 5. Return func.
The key part here being GetMethod(..., @@toPrimitive) should throw a TypeError if the property is not callable (undefined / null handled earlier).
Attachments
[PATCH] Proposed Fix
(14.25 KB, patch)
2017-04-16 12:28 PDT
,
Joseph Pecoraro
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2017-04-16 12:28:07 PDT
Created
attachment 307234
[details]
[PATCH] Proposed Fix
Saam Barati
Comment 2
2017-04-16 13:01:50 PDT
Comment on
attachment 307234
[details]
[PATCH] Proposed Fix r=me
WebKit Commit Bot
Comment 3
2017-04-16 13:20:15 PDT
Comment on
attachment 307234
[details]
[PATCH] Proposed Fix Clearing flags on attachment: 307234 Committed
r215402
: <
http://trac.webkit.org/changeset/215402
>
WebKit Commit Bot
Comment 4
2017-04-16 13:20:16 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug