| 1 |
// Repeat 1448582-{1,3,4}.js for classes. |
| 2 |
|
| 3 |
(function(index) { |
| 4 |
// Does not assert. |
| 5 |
var c = class { constructor(){} }; |
| 6 |
|
| 7 |
if (index === 0) { |
| 8 |
(function self() { |
| 9 |
self.caller(1); |
| 10 |
})(); |
| 11 |
} |
| 12 |
})(0); |
| 13 |
|
| 14 |
(function(index) { |
| 15 |
var c = class { constructor(){} }; |
| 16 |
|
| 17 |
// Accessing |.name| sets the resolved-name flag, which should not be |
| 18 |
// copied over to the function clone. |
| 19 |
assertEq(c.name, "c"); |
| 20 |
|
| 21 |
if (index === 0) { |
| 22 |
(function self() { |
| 23 |
self.caller(1); |
| 24 |
})(); |
| 25 |
} |
| 26 |
})(0); |
| 27 |
|
| 28 |
(function(index) { |
| 29 |
var c = class { constructor(a){} }; |
| 30 |
|
| 31 |
// Accessing |.length| sets the resolved-length flag, which should not be |
| 32 |
// copied over to the function clone. |
| 33 |
assertEq(c.length, 1); |
| 34 |
|
| 35 |
if (index === 0) { |
| 36 |
(function self() { |
| 37 |
self.caller(1); |
| 38 |
})(); |
| 39 |
} |
| 40 |
})(0); |
| 41 |
|
| 42 |
|
| 43 |
// Repeat 1448582-{3,4}.js for generator functions. |
| 44 |
|
| 45 |
(function(index) { |
| 46 |
function* f() {} |
| 47 |
|
| 48 |
// Accessing |.name| sets the resolved-name flag, which should not be |
| 49 |
// copied over to the function clone. |
| 50 |
assertEq(f.name, "f"); |
| 51 |
|
| 52 |
if (index === 0) { |
| 53 |
(function self() { |
| 54 |
self.caller(1); |
| 55 |
})(); |
| 56 |
} |
| 57 |
})(0); |
| 58 |
|
| 59 |
(function(index) { |
| 60 |
function* f(a) {} |
| 61 |
|
| 62 |
// Accessing |.length| sets the resolved-length flag, which should not be |
| 63 |
// copied over to the function clone. |
| 64 |
assertEq(f.length, 1); |
| 65 |
|
| 66 |
if (index === 0) { |
| 67 |
(function self() { |
| 68 |
self.caller(1); |
| 69 |
})(); |
| 70 |
} |
| 71 |
})(0); |
| 72 |
|
| 73 |
|
| 74 |
// Repeat 1448582-{3,4}.js for async functions. |
| 75 |
|
| 76 |
(function(index) { |
| 77 |
async function f() {} |
| 78 |
|
| 79 |
// Accessing |.name| sets the resolved-name flag, which should not be |
| 80 |
// copied over to the function clone. |
| 81 |
assertEq(f.name, "f"); |
| 82 |
|
| 83 |
if (index === 0) { |
| 84 |
(function self() { |
| 85 |
self.caller(1); |
| 86 |
})(); |
| 87 |
} |
| 88 |
})(0); |
| 89 |
|
| 90 |
(function(index) { |
| 91 |
async function f(a) {} |
| 92 |
|
| 93 |
// Accessing |.length| sets the resolved-length flag, which should not be |
| 94 |
// copied over to the function clone. |
| 95 |
assertEq(f.length, 1); |
| 96 |
|
| 97 |
if (index === 0) { |
| 98 |
(function self() { |
| 99 |
self.caller(1); |
| 100 |
})(); |
| 101 |
} |
| 102 |
})(0); |
| 103 |
|
| 104 |
|
| 105 |
// Repeat 1448582-{3,4}.js for async generator functions. |
| 106 |
|
| 107 |
(function(index) { |
| 108 |
async function* f() {} |
| 109 |
|
| 110 |
// Accessing |.name| sets the resolved-name flag, which should not be |
| 111 |
// copied over to the function clone. |
| 112 |
assertEq(f.name, "f"); |
| 113 |
|
| 114 |
if (index === 0) { |
| 115 |
(function self() { |
| 116 |
self.caller(1); |
| 117 |
})(); |
| 118 |
} |
| 119 |
})(0); |
| 120 |
|
| 121 |
(function(index) { |
| 122 |
async function* f(a) {} |
| 123 |
|
| 124 |
// Accessing |.length| sets the resolved-length flag, which should not be |
| 125 |
// copied over to the function clone. |
| 126 |
assertEq(f.length, 1); |
| 127 |
|
| 128 |
if (index === 0) { |
| 129 |
(function self() { |
| 130 |
self.caller(1); |
| 131 |
})(); |
| 132 |
} |
| 133 |
})(0); |