]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/dfg-to-primitive-pass-symbol.js
1 var shouldThrow
= false;
3 // str concat generates op_to_primitive.
4 function toPrimitiveTarget() {
6 return Symbol('Cocoa');
10 noInline(toPrimitiveTarget
);
12 function doToPrimitive() {
13 var value
= toPrimitiveTarget();
14 return value
+ "Cappuccino" + value
;
16 noInline(doToPrimitive
);
18 for (var i
= 0; i
< 10000; ++i
) {
19 var result
= doToPrimitive();
20 if (result
!== "CocoaCappuccinoCocoa")
21 throw "Error: bad result: " + result
;
34 if (String(didThrow
) !== "TypeError: Type error")
35 throw "Error: didn't throw or threw wrong exception: " + didThrow
;