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

Side by Side Diff: test/mjsunit/es6/prototype-ordinary-objects.js

Issue 1072083002: [es6] don't "replace" Object.prototype.toString for --harmony-tostring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Final fixup... 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/v8natives.js ('k') | test/mjsunit/function-arguments-null.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 var funcs = [ 6 var funcs = [
7 7
8 // https://code.google.com/p/v8/issues/detail?id=4002 8 // https://code.google.com/p/v8/issues/detail?id=4002
9 // Error, 9 // Error,
10 // EvalError, 10 // EvalError,
(...skipping 30 matching lines...) Expand all
41 Uint16Array, 41 Uint16Array,
42 Uint32Array, 42 Uint32Array,
43 Uint8Array, 43 Uint8Array,
44 Uint8ClampedArray, 44 Uint8ClampedArray,
45 WeakMap, 45 WeakMap,
46 WeakSet, 46 WeakSet,
47 ]; 47 ];
48 48
49 for (var fun of funcs) { 49 for (var fun of funcs) {
50 var p = fun.prototype; 50 var p = fun.prototype;
51
52 // @@toStringTag is tested separately, and interferes with this test.
53 if (Symbol.toStringTag) delete p[Symbol.toStringTag];
51 assertEquals('[object Object]', Object.prototype.toString.call(p)); 54 assertEquals('[object Object]', Object.prototype.toString.call(p));
52 } 55 }
53 56
54 57
55 // These still have special prototypes for legacy reason. 58 // These still have special prototypes for legacy reason.
56 var funcs = [ 59 var funcs = [
57 Array, 60 Array,
58 Function, 61 Function,
59 ]; 62 ];
60 63
61 for (var fun of funcs) { 64 for (var fun of funcs) {
62 var p = fun.prototype; 65 var p = fun.prototype;
63 assertEquals('[object ' + fun.name + ']', Object.prototype.toString.call(p)); 66 assertEquals(`[object ${fun.name}]`, Object.prototype.toString.call(p));
64 } 67 }
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/function-arguments-null.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698