OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-templates | |
6 | |
7 (function testStringRawArity() { | 5 (function testStringRawArity() { |
8 assertEquals(1, String.raw.length); | 6 assertEquals(1, String.raw.length); |
9 })(); | 7 })(); |
10 | 8 |
11 | 9 |
12 (function testStringRawCallSiteToObject() { | 10 (function testStringRawCallSiteToObject() { |
13 assertThrows("String.raw()", TypeError); | 11 assertThrows("String.raw()", TypeError); |
14 })(); | 12 })(); |
15 | 13 |
16 | 14 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 }); | 247 }); |
250 [1, 3, 5].forEach(function(v, i) { | 248 [1, 3, 5].forEach(function(v, i) { |
251 Object.defineProperty(callSiteObj.raw, i, { | 249 Object.defineProperty(callSiteObj.raw, i, { |
252 get: function() { order.push("raw" + v); return v; } | 250 get: function() { order.push("raw" + v); return v; } |
253 }); | 251 }); |
254 }); | 252 }); |
255 | 253 |
256 assertEquals("12345", String.raw(callSiteObj, arg(2), arg(4), arg(6))); | 254 assertEquals("12345", String.raw(callSiteObj, arg(2), arg(4), arg(6))); |
257 assertEquals(["length", "raw1", "arg2", "raw3", "arg4", "raw5"], order); | 255 assertEquals(["length", "raw1", "arg2", "raw3", "arg4", "raw5"], order); |
258 })(); | 256 })(); |
OLD | NEW |