| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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: --stack-size=100 --harmony | 5 // Flags: --stack-size=100 --harmony |
| 6 // Flags: --harmony-simd | 6 // Flags: --harmony-simd |
| 7 | 7 |
| 8 function test(f, expected, type) { | 8 function test(f, expected, type) { |
| 9 try { | 9 try { |
| 10 f(); | 10 f(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 Object.preventExtensions(o); | 116 Object.preventExtensions(o); |
| 117 Object.defineProperty(o, "x", { value: 1 }); | 117 Object.defineProperty(o, "x", { value: 1 }); |
| 118 }, "Cannot define property:x, object is not extensible.", TypeError); | 118 }, "Cannot define property:x, object is not extensible.", TypeError); |
| 119 | 119 |
| 120 // kFirstArgumentNotRegExp | 120 // kFirstArgumentNotRegExp |
| 121 test(function() { | 121 test(function() { |
| 122 "a".startsWith(/a/); | 122 "a".startsWith(/a/); |
| 123 }, "First argument to String.prototype.startsWith " + | 123 }, "First argument to String.prototype.startsWith " + |
| 124 "must not be a regular expression", TypeError); | 124 "must not be a regular expression", TypeError); |
| 125 | 125 |
| 126 // kFlagsGetterNonObject |
| 127 test(function() { |
| 128 Object.getOwnPropertyDescriptor(RegExp.prototype, "flags").get.call(1); |
| 129 }, "RegExp.prototype.flags getter called on non-object 1", TypeError); |
| 130 |
| 126 // kFunctionBind | 131 // kFunctionBind |
| 127 test(function() { | 132 test(function() { |
| 128 Function.prototype.bind.call(1); | 133 Function.prototype.bind.call(1); |
| 129 }, "Bind must be called on a function", TypeError); | 134 }, "Bind must be called on a function", TypeError); |
| 130 | 135 |
| 131 // kGeneratorRunning | 136 // kGeneratorRunning |
| 132 test(function() { | 137 test(function() { |
| 133 var iter; | 138 var iter; |
| 134 function* generator() { yield iter.next(); } | 139 function* generator() { yield iter.next(); } |
| 135 var iter = generator(); | 140 var iter = generator(); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 Number(1).toString(100); | 450 Number(1).toString(100); |
| 446 }, "toString() radix argument must be between 2 and 36", RangeError); | 451 }, "toString() radix argument must be between 2 and 36", RangeError); |
| 447 | 452 |
| 448 | 453 |
| 449 // === URIError === | 454 // === URIError === |
| 450 | 455 |
| 451 // kURIMalformed | 456 // kURIMalformed |
| 452 test(function() { | 457 test(function() { |
| 453 decodeURI("%%"); | 458 decodeURI("%%"); |
| 454 }, "URI malformed", URIError); | 459 }, "URI malformed", URIError); |
| OLD | NEW |