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

Side by Side Diff: src/js/harmony-string-padding.js

Issue 2222893002: Move family of MakeError functions to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix in prologue.js Created 4 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 // Imports 10 // Imports
11 11
12 var GlobalString = global.String; 12 var GlobalString = global.String;
13 var MakeTypeError;
14
15 utils.Import(function(from) {
16 MakeTypeError = from.MakeTypeError;
17 });
18 13
19 // ------------------------------------------------------------------- 14 // -------------------------------------------------------------------
20 // http://tc39.github.io/proposal-string-pad-start-end/ 15 // http://tc39.github.io/proposal-string-pad-start-end/
21 16
22 function StringPad(thisString, maxLength, fillString) { 17 function StringPad(thisString, maxLength, fillString) {
23 maxLength = TO_LENGTH(maxLength); 18 maxLength = TO_LENGTH(maxLength);
24 var stringLength = thisString.length; 19 var stringLength = thisString.length;
25 20
26 if (maxLength <= stringLength) return ""; 21 if (maxLength <= stringLength) return "";
27 22
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return thisString + StringPad(thisString, maxLength, fillString); 64 return thisString + StringPad(thisString, maxLength, fillString);
70 } 65 }
71 %FunctionSetLength(StringPadEnd, 1); 66 %FunctionSetLength(StringPadEnd, 1);
72 67
73 utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [ 68 utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
74 "padStart", StringPadStart, 69 "padStart", StringPadStart,
75 "padEnd", StringPadEnd 70 "padEnd", StringPadEnd
76 ]); 71 ]);
77 72
78 }); 73 });
OLDNEW
« src/bootstrapper.cc ('K') | « src/js/harmony-simd.js ('k') | src/js/i18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698