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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 for (var f of errorFunctions) { | 71 for (var f of errorFunctions) { |
72 assertPrototypeOf(f, Error); | 72 assertPrototypeOf(f, Error); |
73 assertPrototypeOf(new f(), f.prototype); | 73 assertPrototypeOf(new f(), f.prototype); |
74 } | 74 } |
75 | 75 |
76 | 76 |
77 // Builtin constructors. | 77 // Builtin constructors. |
78 var functions = [ | 78 var functions = [ |
79 Array, | 79 Array, |
80 ArrayBuffer, | |
81 Boolean, | 80 Boolean, |
82 // DataView, | 81 // DataView, |
83 Date, | 82 Date, |
84 Error, | 83 Error, |
85 Float32Array, | 84 Float32Array, |
86 Float64Array, | 85 Float64Array, |
87 Function, | 86 Function, |
88 Int16Array, | 87 Int16Array, |
89 Int32Array, | 88 Int32Array, |
90 Int8Array, | 89 Int8Array, |
(...skipping 14 matching lines...) Expand all Loading... |
105 ]; | 104 ]; |
106 | 105 |
107 for (var f of functions) { | 106 for (var f of functions) { |
108 assertPrototypeOf(f, Function.prototype); | 107 assertPrototypeOf(f, Function.prototype); |
109 assertPrototypeOf(new f(), f.prototype); | 108 assertPrototypeOf(new f(), f.prototype); |
110 } | 109 } |
111 | 110 |
112 var p = new Promise(function() {}); | 111 var p = new Promise(function() {}); |
113 assertPrototypeOf(p, Promise.prototype); | 112 assertPrototypeOf(p, Promise.prototype); |
114 | 113 |
115 var dv = new DataView(new ArrayBuffer()); | 114 var ab = new ArrayBuffer(0); |
| 115 assertPrototypeOf(ab, ArrayBuffer.prototype); |
| 116 |
| 117 var dv = new DataView(ab); |
116 assertPrototypeOf(dv, DataView.prototype); | 118 assertPrototypeOf(dv, DataView.prototype); |
OLD | NEW |