Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1563)

Side by Side Diff: LayoutTests/fast/js/function-dot-arguments-and-caller.html

Issue 14195011: Removed WONTFIX tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <p>This page tests function.caller and function.arguments in interesting nested scopes.
2 </p>
3 <p>If the test passes, you'll see a series of PASS messages below.
4 </p>
5 <pre id="console"></pre>
6
7 <script>
8 function log(s)
9 {
10 document.getElementById("console").appendChild(document.createTextNode(s + " \n"));
11 }
12
13 if (window.testRunner)
14 testRunner.dumpAsText();
15
16 function f() { return this.eval('f.arguments instanceof Object ? "PASS" : "FAIL" '); }
17
18 var resultArray = [
19 // ----- arguments -----
20
21 // function scope inside global eval scope, uncalled function
22 (function g() { return this.eval('f.arguments instanceof Object ? "FAIL" : "PASS "'); })(),
23
24 // function scope inside local eval scope, uncalled function
25 (function g() { return eval('f.arguments instanceof Object ? "FAIL" : "PASS"'); })(),
26
27 // global eval scope, called function
28 f(),
29
30 // local eval scope, called function
31 (function f() { return eval('f.arguments instanceof Object ? "PASS" : "FAIL"'); })(),
32
33 // eval scope, uncalled function
34 eval('(function () { }).arguments instanceof Object ? "FAIL" : "PASS"'),
35
36 // re-entrant function scope, outer called function
37 (function f() {
38 return String({ toString: function g() { return f.arguments instanceof Objec t ? "PASS" : "FAIL"; } });
39 })(),
40
41 // re-entrant function scope, inner called function
42 (function f() {
43 return String({ toString: function g() { return g.arguments instanceof Objec t ? "PASS" : "FAIL"; } });
44 })(),
45
46 // function scope, outer called function
47 (function f() {
48 return (function g() {
49 return f.arguments instanceof Object ? "PASS" : "FAIL";
50 })();
51 })(),
52
53 // function scope, inner called function
54 (function f() {
55 return (function g() {
56 return g.arguments instanceof Object ? "PASS" : "FAIL";
57 })();
58 })(),
59
60 // function scope, uncalled function
61 (function f() {
62 return (function g() { }).arguments instanceof Object ? "FAIL" : "PASS";
63 })(),
64
65 // global scope, uncalled function
66 (function () { }).arguments instanceof Object ? "FAIL" : "PASS",
67
68 // ----- caller -----
69
70 (function f() {
71 return (function g() {
72 return g.caller instanceof Object ? "PASS" : "FAIL";
73 })();
74 })(),
75
76 (function f() { return f.caller instanceof Object ? "FAIL" : "PASS"; })(),
77
78 (function () { }).caller instanceof Object ? "FAIL" : "PASS",
79
80 eval('(function f() { return f.caller instanceof Object ? "FAIL" : "PASS"; })()' ),
81
82 (function f() {
83 return String({ toString: function g() { return g.caller instanceof Object ? "PASS" : "FAIL"; } });
84 })(),
85
86 (function f() {
87 function g() { return h.apply(this); }
88 function h() { return k(); }
89 function k() { return k.caller instanceof Object ? "PASS" : "FAIL"; }
90
91 return g();
92 })()
93 ];
94
95 log(resultArray);
96 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698