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

Unified Diff: src/objects.h

Issue 2018963002: [builtins] Migrate String.prototype.trim/trimLeft/trimRight to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 24436f735ce89141de45a18086f18b1d4c646d67..13e1d8280abf422ee4a4144b194d9ce633627764 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -8860,6 +8860,14 @@ class String: public Name {
// Conversion.
inline bool AsArrayIndex(uint32_t* index);
+ // Trimming.
+ enum TrimMode : uint8_t {
+ kTrimLeft = 1u << 0,
+ kTrimRight = 1u << 1,
+ kTrim = kTrimLeft | kTrimRight
+ };
+ static Handle<String> Trim(Handle<String> string, TrimMode mode);
+
DECLARE_CAST(String)
void PrintOn(FILE* out);

Powered by Google App Engine
This is Rietveld 408576698