Home | History | Annotate | Download | only in es6
      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 
      6 var funcs = [
      7 
      8   // https://code.google.com/p/v8/issues/detail?id=4002
      9   // Error,
     10   // EvalError,
     11   // RangeError,
     12   // ReferenceError,
     13   // SyntaxError,
     14   // TypeError,
     15   // URIError,
     16 
     17   // https://code.google.com/p/v8/issues/detail?id=4003
     18   // RegExp,
     19 
     20   // https://code.google.com/p/v8/issues/detail?id=4004
     21   // Date,
     22 
     23   // https://code.google.com/p/v8/issues/detail?id=4006
     24   // String,
     25 
     26   // Boolean,
     27   // Number,
     28   // https://code.google.com/p/v8/issues/detail?id=4001
     29 
     30   ArrayBuffer,
     31   DataView,
     32   Float32Array,
     33   Float64Array,
     34   Int16Array,
     35   Int32Array,
     36   Int8Array,
     37   Map,
     38   Object,
     39   Promise,
     40   // Proxy,
     41   Set,
     42   Symbol,
     43   Uint16Array,
     44   Uint32Array,
     45   Uint8Array,
     46   Uint8ClampedArray,
     47   WeakMap,
     48   WeakSet,
     49 ];
     50 
     51 for (var fun of funcs) {
     52   var p = fun.prototype;
     53 
     54   // @@toStringTag is tested separately, and interferes with this test.
     55   if (Symbol.toStringTag) delete p[Symbol.toStringTag];
     56   assertEquals('[object Object]', Object.prototype.toString.call(p));
     57 }
     58 
     59 
     60 // These still have special prototypes for legacy reason.
     61 var funcs = [
     62   Array,
     63   Function,
     64 ];
     65 
     66 for (var fun of funcs) {
     67   var p = fun.prototype;
     68   assertEquals(`[object ${fun.name}]`, Object.prototype.toString.call(p));
     69 }
     70