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

Side by Side Diff: src/harmony-typedarray.js

Issue 1086313003: Migrate error messages, part 2. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « src/harmony-array.js ('k') | src/messages.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Array = global.Array; 9 // var $Array = global.Array;
10 10
(...skipping 13 matching lines...) Expand all
24 endmacro 24 endmacro
25 25
26 26
27 macro TYPED_ARRAY_HARMONY_ADDITIONS(ARRAY_ID, NAME, ELEMENT_SIZE) 27 macro TYPED_ARRAY_HARMONY_ADDITIONS(ARRAY_ID, NAME, ELEMENT_SIZE)
28 28
29 // ES6 draft 08-24-14, section 22.2.3.12 29 // ES6 draft 08-24-14, section 22.2.3.12
30 function NAMEForEach(f /* thisArg */) { // length == 1 30 function NAMEForEach(f /* thisArg */) { // length == 1
31 if (!%IsTypedArray(this)) { 31 if (!%IsTypedArray(this)) {
32 throw MakeTypeError('not_typed_array', []); 32 throw MakeTypeError('not_typed_array', []);
33 } 33 }
34 if (!IS_SPEC_FUNCTION(f)) { 34 if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
35 throw MakeTypeError('called_non_callable', [ f ]);
36 }
37 35
38 var length = %_TypedArrayGetLength(this); 36 var length = %_TypedArrayGetLength(this);
39 var receiver; 37 var receiver;
40 38
41 if (%_ArgumentsLength() > 1) { 39 if (%_ArgumentsLength() > 1) {
42 receiver = %_Arguments(1); 40 receiver = %_Arguments(1);
43 } 41 }
44 42
45 var needs_wrapper = false; 43 var needs_wrapper = false;
46 if (IS_NULL_OR_UNDEFINED(receiver)) { 44 if (IS_NULL_OR_UNDEFINED(receiver)) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // Set up non-enumerable functions on the prototype object. 84 // Set up non-enumerable functions on the prototype object.
87 InstallFunctions(global.NAME.prototype, DONT_ENUM, [ 85 InstallFunctions(global.NAME.prototype, DONT_ENUM, [
88 "forEach", NAMEForEach 86 "forEach", NAMEForEach
89 ]); 87 ]);
90 endmacro 88 endmacro
91 89
92 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) 90 TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
93 } 91 }
94 92
95 HarmonyTypedArrayExtendPrototypes(); 93 HarmonyTypedArrayExtendPrototypes();
OLDNEW
« no previous file with comments | « src/harmony-array.js ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698