| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 | 76 |
| 77 // Builtin constructors. | 77 // Builtin constructors. |
| 78 var functions = [ | 78 var functions = [ |
| 79 Array, | 79 Array, |
| 80 ArrayBuffer, | 80 ArrayBuffer, |
| 81 Boolean, | 81 Boolean, |
| 82 // DataView, | 82 // DataView, |
| 83 Date, | 83 Date, |
| 84 Error, | 84 Error, |
| 85 Float32Array, |
| 86 Float64Array, |
| 85 Function, | 87 Function, |
| 88 Int16Array, |
| 89 Int32Array, |
| 90 Int8Array, |
| 86 Map, | 91 Map, |
| 87 Number, | 92 Number, |
| 88 Object, | 93 Object, |
| 89 // Promise, | 94 // Promise, |
| 90 RegExp, | 95 RegExp, |
| 91 Set, | 96 Set, |
| 92 String, | 97 String, |
| 93 // Symbol, not constructible | 98 // Symbol, not constructible |
| 99 Uint16Array, |
| 100 Uint32Array, |
| 101 Uint8Array, |
| 102 Uint8ClampedArray, |
| 94 WeakMap, | 103 WeakMap, |
| 95 WeakSet, | 104 WeakSet, |
| 96 ]; | 105 ]; |
| 97 | 106 |
| 98 for (var f of functions) { | 107 for (var f of functions) { |
| 99 assertPrototypeOf(f, Function.prototype); | 108 assertPrototypeOf(f, Function.prototype); |
| 100 assertPrototypeOf(new f(), f.prototype); | 109 assertPrototypeOf(new f(), f.prototype); |
| 101 } | 110 } |
| 102 | 111 |
| 103 var typedArrayConstructors = [ | |
| 104 Float32Array, | |
| 105 Float64Array, | |
| 106 Int16Array, | |
| 107 Int32Array, | |
| 108 Int8Array, | |
| 109 Uint16Array, | |
| 110 Uint32Array, | |
| 111 Uint8Array, | |
| 112 Uint8ClampedArray, | |
| 113 ]; | |
| 114 | |
| 115 for (var t of typedArrayConstructors) { | |
| 116 assertPrototypeOf(t, Uint8Array.__proto__); | |
| 117 assertPrototypeOf(new t(), t.prototype); | |
| 118 } | |
| 119 | |
| 120 var p = new Promise(function() {}); | 112 var p = new Promise(function() {}); |
| 121 assertPrototypeOf(p, Promise.prototype); | 113 assertPrototypeOf(p, Promise.prototype); |
| 122 | 114 |
| 123 var dv = new DataView(new ArrayBuffer()); | 115 var dv = new DataView(new ArrayBuffer()); |
| 124 assertPrototypeOf(dv, DataView.prototype); | 116 assertPrototypeOf(dv, DataView.prototype); |
| OLD | NEW |