Bug 158062
| Summary: | "use strict"; delete ProgressEvent.length; should not throw | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Pieters (:zcorpan) <zcorpan> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | mark.lam, saam, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Simon Pieters (:zcorpan)
See https://github.com/w3c/web-platform-tests/pull/3068
This fails in WebKit:
<!DOCTYPE html>
<script>
"use strict";
try {
delete ProgressEvent.length;
w('PASS');
} catch(e) {
w('FAIL');
}
</script>
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4231
Per ES6 deleting a function's "length" property should apparently not throw (even in strict mode). It throws in WebKit for a vanilla function:
<!DOCTYPE html>
<script>
"use strict";
var x = function(x) {};
try {
delete x.length;
w('PASS');
} catch(e) {
w('FAIL');
}
</script>
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4232
Also, the ProgressEvent interface object is typeof "object" in WebKit but per WebIDL should be "function".
<!DOCTYPE html>
<script>
w(typeof ProgressEvent == "function" ? "PASS" : "FAIL");
</script>
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4233
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Simon Pieters (:zcorpan)
Or, this should be true:
Object.getOwnPropertyDescriptor(function(){}, 'length').configurable
It seems this bug is a dup of the following two bugs:
https://bugs.webkit.org/show_bug.cgi?id=124598
https://bugs.webkit.org/show_bug.cgi?id=145460
*** This bug has been marked as a duplicate of bug 145460 ***