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

Side by Side Diff: src/js/arraybuffer.js

Issue 1474343002: Use new.target in favor of %_IsConstructCall intrinsic (2). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_js-use-new-target-1
Patch Set: Skip ignition. Created 5 years 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 | « no previous file | src/js/i18n.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 11 matching lines...) Expand all
22 utils.Import(function(from) { 22 utils.Import(function(from) {
23 MakeTypeError = from.MakeTypeError; 23 MakeTypeError = from.MakeTypeError;
24 MaxSimple = from.MaxSimple; 24 MaxSimple = from.MaxSimple;
25 MinSimple = from.MinSimple; 25 MinSimple = from.MinSimple;
26 ToPositiveInteger = from.ToPositiveInteger; 26 ToPositiveInteger = from.ToPositiveInteger;
27 }); 27 });
28 28
29 // ------------------------------------------------------------------- 29 // -------------------------------------------------------------------
30 30
31 function ArrayBufferConstructor(length) { // length = 1 31 function ArrayBufferConstructor(length) { // length = 1
32 if (%_IsConstructCall()) { 32 if (!IS_UNDEFINED(new.target)) {
33 var byteLength = ToPositiveInteger(length, kInvalidArrayBufferLength); 33 var byteLength = ToPositiveInteger(length, kInvalidArrayBufferLength);
34 %ArrayBufferInitialize(this, byteLength, kNotShared); 34 %ArrayBufferInitialize(this, byteLength, kNotShared);
35 } else { 35 } else {
36 throw MakeTypeError(kConstructorNotFunction, "ArrayBuffer"); 36 throw MakeTypeError(kConstructorNotFunction, "ArrayBuffer");
37 } 37 }
38 } 38 }
39 39
40 function ArrayBufferGetByteLen() { 40 function ArrayBufferGetByteLen() {
41 if (!IS_ARRAYBUFFER(this)) { 41 if (!IS_ARRAYBUFFER(this)) {
42 throw MakeTypeError(kIncompatibleMethodReceiver, 42 throw MakeTypeError(kIncompatibleMethodReceiver,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 utils.InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [ 104 utils.InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [
105 "isView", ArrayBufferIsViewJS 105 "isView", ArrayBufferIsViewJS
106 ]); 106 ]);
107 107
108 utils.InstallFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [ 108 utils.InstallFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [
109 "slice", ArrayBufferSlice 109 "slice", ArrayBufferSlice
110 ]); 110 ]);
111 111
112 }) 112 })
OLDNEW
« no previous file with comments | « no previous file | src/js/i18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698