Bug 158062 - "use strict"; delete ProgressEvent.length; should not throw
Summary: "use strict"; delete ProgressEvent.length; should not throw
Status: RESOLVED DUPLICATE of bug 145460
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-25 02:39 PDT by Simon Pieters (:zcorpan)
Modified: 2016-05-25 07:47 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Pieters (:zcorpan) 2016-05-25 02:39:59 PDT
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
Comment 1 Simon Pieters (:zcorpan) 2016-05-25 03:08:19 PDT
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 ***