Re: [heycam/webidl] Named properties object: allow symbols in [[DefineOwnProperty]] and [[Delete]] (#963)

Given the following example:

```html
<!DOCTYPE html>
<form name=foo></form>
<script>
const wp = Object.getPrototypeOf(Window.prototype);
wp.foo = 1;
</script>
```

@yuki3 Is it possible so the `[[Set]]` is ignored? Currently it is an interop issue: Firefox throws (it should't since no `"use strict"` there, but ok), while Chrome creates expando `foo` property that shadows `<form name=foo>`.

@annevk current spec does comply to invariants, but makes `Object.defineProperty` unnecessarily weird. Module namespace object's `[[DefineOwnProperty]]` used to [return `false` unconditionally in ES6](https://262.ecma-international.org/6.0/#sec-module-namespace-exotic-objects-defineownproperty-p-desc), but was [later relaxed](https://github.com/tc39/ecma262/pull/858) to be inline with ordinary counterpart.

In perfect world, it would be nice to do the same for `WindowProperties`. I don't really have hard opinion on whether symbols should be allowed or what descriptors should they have.

On implementation side, WebCore uses JavaScriptCore classes directly, without the API, so it's possible to implement anything that can be spec-ed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/963#issuecomment-797452734

Received on Friday, 12 March 2021 12:13:19 UTC