Status: New
Owner: ----
New issue 3964 by [email protected]: Object.{getPrototypeOf,
getOwnPropertyDescriptor}(non-object) throws TypeError in violation of spec
https://code.google.com/p/v8/issues/detail?id=3964
19.1.2.9
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.getprototypeof
19.1.2.6
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.getownpropertydescriptor
1. Let obj be ToObject(O).
According to 7.1.13
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject :
ToObject(undefined) => Throw TypeError
ToObject(null) => Throw TypeError
ToObject(true) => new Boolean(true)
ToObject(false) => new Boolean(false)
ToObject(1) => new Number(1)
ToObject("") => new String("")
let sym = Symbol("desc");
ToObject(sym) => Symbol(sym[[Description]] || "")
let o = {};
ToObject(o) => o
So, e.g. Object.getPrototypeOf (and others listed) must follow the same
rules:
Object.getPrototypeOf(undefined) => ToObject(undefined) => Throw TypeError
Object.getPrototypeOf(null) => ToObject(null) => Throw TypeError
Object.getPrototypeOf(true) => ToObject(true) => new Boolean(true)
=> %BooleanPrototype%
Object.getPrototypeOf(false) => ToObject(false) => new Boolean(false)
=> %BooleanPrototype%
Object.getPrototypeOf(1) => ToObject(1) => new Number(1)
=> %NumberPrototype%
Object.getPrototypeOf("") => ToObject("") => new String("")
=> %StringPrototype%
let sym = Symbol("desc");
Object.getPrototypeOf(sym) => ToObject(sym) => Symbol(sym[[Description]] |
| "") => %SymbolPrototype%
let o = {};
Object.getPrototypeOf(o) => ToObject(o) => o => %[[IntrinsicPrototype]]%
(IntrinsicPrototype may be any Well Known Intrinsic that identifies as an
object)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.