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

Side by Side Diff: src/arraybuffer.js

Issue 21924007: Make new Harmony constructors subclassing-friendly (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/collection.js » ('j') | src/collection.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 14 matching lines...) Expand all
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 "use strict"; 28 "use strict";
29 29
30 var $ArrayBuffer = global.ArrayBuffer; 30 var $ArrayBuffer = global.ArrayBuffer;
31 31
32 // ------------------------------------------------------------------- 32 // -------------------------------------------------------------------
33 33
34 function ArrayBufferConstructor(length) { // length = 1 34 function ArrayBufferConstructor(length) { // length = 1
35 if (%_IsConstructCall()) { 35 var byteLength = ToPositiveInteger(length, 'invalid_array_buffer_length');
36 var byteLength = ToPositiveInteger(length, 'invalid_array_buffer_length'); 36 %ArrayBufferInitialize(this, byteLength);
37 %ArrayBufferInitialize(this, byteLength);
38 } else {
39 throw MakeTypeError('constructor_not_function', ["ArrayBuffer"]);
40 }
41 } 37 }
42 38
43 function ArrayBufferGetByteLength() { 39 function ArrayBufferGetByteLength() {
44 if (!IS_ARRAYBUFFER(this)) { 40 if (!IS_ARRAYBUFFER(this)) {
45 throw MakeTypeError('incompatible_method_receiver', 41 throw MakeTypeError('incompatible_method_receiver',
46 ['ArrayBuffer.prototype.byteLength', this]); 42 ['ArrayBuffer.prototype.byteLength', this]);
47 } 43 }
48 return %ArrayBufferGetByteLength(this); 44 return %ArrayBufferGetByteLength(this);
49 } 45 }
50 46
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 InstallGetter($ArrayBuffer.prototype, "byteLength", ArrayBufferGetByteLength); 90 InstallGetter($ArrayBuffer.prototype, "byteLength", ArrayBufferGetByteLength);
95 91
96 InstallFunctions($ArrayBuffer.prototype, DONT_ENUM, $Array( 92 InstallFunctions($ArrayBuffer.prototype, DONT_ENUM, $Array(
97 "slice", ArrayBufferSlice 93 "slice", ArrayBufferSlice
98 )); 94 ));
99 } 95 }
100 96
101 SetUpArrayBuffer(); 97 SetUpArrayBuffer();
102 98
103 99
OLDNEW
« no previous file with comments | « no previous file | src/collection.js » ('j') | src/collection.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698