Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / mozilla / strict / script-tests / function-name-arity.js
blob7e4e6e99a91ed634aab124563ed16283af0dac73
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /*
4 * Any copyright is dedicated to the Public Domain.
5 * http://creativecommons.org/licenses/publicdomain/
6 */
8 function fn() {
9 return function f(a, b, c) { };
12 assertEq(testLenientAndStrict('var f = fn(); f.name = "g"; f.name',
13 returns("f"), raisesException(TypeError)),
14 true);
15 assertEq(testLenientAndStrict('var f = fn(); delete f.name',
16 returns(false), raisesException(TypeError)),
17 true);
19 // arity is not a spec defined property of Function.
20 assertEq(testLenientAndStrict('var f = fn(); f.arity = 4; f.arity',
21 returns(4), returns(4)),
22 true);
23 // arity is not a spec defined property of Function.
24 assertEq(testLenientAndStrict('var f = fn(); delete f.arity',
25 returns(true), returns(true)),
26 true);
28 reportCompare(true, true);
30 var successfullyParsed = true;