- From: Igor Sheludko <notifications@github.com>
- Date: Fri, 26 Jun 2026 06:12:50 -0700
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 26 June 2026 13:12:54 UTC
isheludko left a comment (whatwg/webidl#1536)
Chromium does throw in strict mode and does not throw in sloppy mode (same as natural behavior for JavaScript code).
However, current Safari and Firefox throw neither in strict nor in sloppy mode (which is what the spec currently requires).
Just in case, here's the repro.html demonstrating the issue:
```
<!doctype html>
<meta charset=utf-8>
<div id="foo"></div>
<script>
// "use strict";
const collection = document.getElementsByTagName("div");
console.log('collection.foo is: ' + collection.foo);
const obj = Object.create(collection);
console.log('obj.foo is: ' + obj.foo);
console.log('Overwriting obj.foo with "blah"');
obj.foo = "blah"; // Chromium rejects this write and also throws in strict mode.
console.log('obj.foo is: ' + obj.foo + ' (should be "blah")');
console.log('collection.foo is: ' + collection.foo);
</script>
```
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1536#issuecomment-4809899521
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/issues/1536/4809899521@github.com>
Received on Friday, 26 June 2026 13:12:54 UTC