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

Side by Side Diff: test/mjsunit/messages.js

Issue 1086313003: Migrate error messages, part 2. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/weak-collection.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 function test(f, expected, type) {
6 try {
7 f();
8 assertUnreachable();
9 } catch (e) {
10 assertInstanceof(e, type);
11 assertEquals(expected, e.message);
12 }
13 }
14
15 // === Error ===
16
17 // kCyclicProto
18 test(function() {
19 var o = {};
20 o.__proto__ = o;
21 }, "Cyclic __proto__ value", Error);
22
23
24 // === TypeError ===
25
26 // kGeneratorRunning
27 test(function() {
28 var iter;
29 function* generator() { yield iter.next(); }
30 var iter = generator();
31 iter.next();
32 }, "Generator is already running", TypeError);
33
34 // kCalledNonCallable
35 test(function() {
36 [].forEach(1);
37 }, "1 is not a function", TypeError);
38
39 // kIncompatibleMethodReceiver
40 test(function() {
41 RegExp.prototype.compile.call(RegExp.prototype);
42 }, "Method RegExp.prototype.compile called on incompatible receiver " +
43 "[object RegExp]", TypeError);
44
45 // kPropertyNotFunction
46 test(function() {
47 Set.prototype.add = 0;
48 new Set(1);
49 }, "Property 'add' of object #<Set> is not a function", TypeError);
50
51 // kWithExpression
52 test(function() {
53 with (null) {}
54 }, "null has no properties", TypeError);
OLDNEW
« no previous file with comments | « src/weak-collection.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698