script: Properly throw when "this" is not an object in a generic call.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-17 08:01:35 +02:00
parent 5281fc1a44
commit 91f238f326
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 29 additions and 2 deletions

View file

@ -14739,6 +14739,12 @@
{}
]
],
"mozilla/invalid-this.html": [
[
"/_mozilla/mozilla/invalid-this.html",
{}
]
],
"mozilla/iterable.html": [
[
"/_mozilla/mozilla/iterable.html",
@ -28074,6 +28080,10 @@
"c9dcc4f24540914b3be1ef18f13b721773eb76be",
"testharness"
],
"mozilla/invalid-this.html": [
"4ed18511e6399b356fe196b92f72dd16a9019f55",
"testharness"
],
"mozilla/iterable.html": [
"66f05b1f12b8be392705f5ba4a96c70b9226721d",
"testharness"

View file

@ -0,0 +1,13 @@
<!doctype html>
<meta charset="utf-8">
<title>Test for #18535: Wrong type arguments to some JS functions abort the execution of the script.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
assert_throws(new TypeError(), function() { window.atob.call("", localStorage); })
assert_throws(new TypeError(), function() { window.removeEventListener.call("", ""); })
assert_throws(new TypeError(), function() { window.alert.call(""); })
assert_throws(new TypeError(), function() { window.moveTo.call(128); })
})
</script>