{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/ecmascript_simd/issues/338","repository_url":"https://api.github.com/repos/tc39/ecmascript_simd","labels_url":"https://api.github.com/repos/tc39/ecmascript_simd/issues/338/labels{/name}","comments_url":"https://api.github.com/repos/tc39/ecmascript_simd/issues/338/comments","events_url":"https://api.github.com/repos/tc39/ecmascript_simd/issues/338/events","html_url":"https://github.com/tc39/ecmascript_simd/issues/338","id":141993007,"number":338,"title":"Clarification of SIMD objects vs values","user":{"login":"stoklund","id":12660495,"avatar_url":"https://avatars.githubusercontent.com/u/12660495?v=3","gravatar_id":"","url":"https://api.github.com/users/stoklund","html_url":"https://github.com/stoklund","followers_url":"https://api.github.com/users/stoklund/followers","following_url":"https://api.github.com/users/stoklund/following{/other_user}","gists_url":"https://api.github.com/users/stoklund/gists{/gist_id}","starred_url":"https://api.github.com/users/stoklund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stoklund/subscriptions","organizations_url":"https://api.github.com/users/stoklund/orgs","repos_url":"https://api.github.com/users/stoklund/repos","events_url":"https://api.github.com/users/stoklund/events{/privacy}","received_events_url":"https://api.github.com/users/stoklund/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-18T22:31:26Z","updated_at":"2016-03-18T22:37:21Z","closed_at":null,"body":"The spec text talks about SIMD _objects_ and SIMD _values_, where a SIMD object is an object with an internal `[[SIMDData]]` slot holding a SIMD value. The [section about the SIMD constructor prototype](http://tc39.github.io/ecmascript_simd/#simd-proto) talks about a `[[SIMDWrapperData]]` slot. I assume that is that same thing?\r\n\r\nConsider this code:\r\n```js\r\nx = SIMD.Int32x4(1,2,3,4);\r\ny = Object(x);\r\ntypeof y;                // \"object\"\r\ny.toString();            // \"SIMD.Int32x4(1, 2, 3, 4)\".\r\ntypeof x;                // \"int32x4\"\r\nx.toString();            // TypeError!\r\n```\r\nThe last line will throw a TypeError because the `SIMD.Int32x4.prototype.toString` method requires a SIMD _object_. I wonder if that is intentional?\r\n\r\nCompare to [the `Symbol.prototype.toString` method](https://tc39.github.io/ecma262/#sec-symbol.prototype.tostring) which accepts both a symbol value _and_ an object wrapping a symbol.\r\n\r\nSomething similar is going on with the `valueOf` and `toLocaleString` methods."},"comment":{"url":"https://api.github.com/repos/tc39/ecmascript_simd/issues/comments/198568638","html_url":"https://github.com/tc39/ecmascript_simd/issues/338#issuecomment-198568638","issue_url":"https://api.github.com/repos/tc39/ecmascript_simd/issues/338","id":198568638,"user":{"login":"littledan","id":189835,"avatar_url":"https://avatars.githubusercontent.com/u/189835?v=3","gravatar_id":"","url":"https://api.github.com/users/littledan","html_url":"https://github.com/littledan","followers_url":"https://api.github.com/users/littledan/followers","following_url":"https://api.github.com/users/littledan/following{/other_user}","gists_url":"https://api.github.com/users/littledan/gists{/gist_id}","starred_url":"https://api.github.com/users/littledan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littledan/subscriptions","organizations_url":"https://api.github.com/users/littledan/orgs","repos_url":"https://api.github.com/users/littledan/repos","events_url":"https://api.github.com/users/littledan/events{/privacy}","received_events_url":"https://api.github.com/users/littledan/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T22:37:21Z","updated_at":"2016-03-18T22:37:21Z","body":"Looks like you found two spec bugs here--good catch!\r\n\r\nSIMDWrapperData was renamed SIMDData, but sounds like I missed one usage.\r\n\r\nSIMD generally tries to follow the precedent set by Symbol, so we should be accepting of primitive receivers here and make the second change you suggest.\r\n\r\nInterested in writing a PR to fix these?"}}