OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 9386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9397 // character or string equality and collating order defined in the Unicode | 9397 // character or string equality and collating order defined in the Unicode |
9398 // specification. Therefore String values that are canonically equal according | 9398 // specification. Therefore String values that are canonically equal according |
9399 // to the Unicode standard could test as unequal. In effect this algorithm | 9399 // to the Unicode standard could test as unequal. In effect this algorithm |
9400 // assumes that both Strings are already in normalized form. Also, note that | 9400 // assumes that both Strings are already in normalized form. Also, note that |
9401 // for strings containing supplementary characters, lexicographic ordering on | 9401 // for strings containing supplementary characters, lexicographic ordering on |
9402 // sequences of UTF-16 code unit values differs from that on sequences of code | 9402 // sequences of UTF-16 code unit values differs from that on sequences of code |
9403 // point values. | 9403 // point values. |
9404 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x, | 9404 MUST_USE_RESULT static ComparisonResult Compare(Handle<String> x, |
9405 Handle<String> y); | 9405 Handle<String> y); |
9406 | 9406 |
| 9407 // Perform ES6 21.1.3.8, including checking arguments. |
| 9408 static Object* IndexOf(Isolate* isolate, Handle<Object> receiver, |
| 9409 Handle<Object> search, Handle<Object> position); |
9407 // Perform string match of pattern on subject, starting at start index. | 9410 // Perform string match of pattern on subject, starting at start index. |
9408 // Caller must ensure that 0 <= start_index <= sub->length(). | 9411 // Caller must ensure that 0 <= start_index <= sub->length(), as this does not |
9409 static int IndexOf(Isolate* isolate, Handle<String> sub, Handle<String> pat, | 9412 // check any arguments. |
9410 int start_index); | 9413 static int IndexOf(Isolate* isolate, Handle<String> receiver, |
| 9414 Handle<String> search, int start_index); |
9411 | 9415 |
9412 static Object* LastIndexOf(Isolate* isolate, Handle<Object> receiver, | 9416 static Object* LastIndexOf(Isolate* isolate, Handle<Object> receiver, |
9413 Handle<Object> search, Handle<Object> position); | 9417 Handle<Object> search, Handle<Object> position); |
9414 | 9418 |
9415 // String equality operations. | 9419 // String equality operations. |
9416 inline bool Equals(String* other); | 9420 inline bool Equals(String* other); |
9417 inline static bool Equals(Handle<String> one, Handle<String> two); | 9421 inline static bool Equals(Handle<String> one, Handle<String> two); |
9418 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); | 9422 bool IsUtf8EqualTo(Vector<const char> str, bool allow_prefix_match = false); |
9419 bool IsOneByteEqualTo(Vector<const uint8_t> str); | 9423 bool IsOneByteEqualTo(Vector<const uint8_t> str); |
9420 bool IsTwoByteEqualTo(Vector<const uc16> str); | 9424 bool IsTwoByteEqualTo(Vector<const uc16> str); |
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11405 } | 11409 } |
11406 return value; | 11410 return value; |
11407 } | 11411 } |
11408 }; | 11412 }; |
11409 | 11413 |
11410 | 11414 |
11411 } // NOLINT, false-positive due to second-order macros. | 11415 } // NOLINT, false-positive due to second-order macros. |
11412 } // NOLINT, false-positive due to second-order macros. | 11416 } // NOLINT, false-positive due to second-order macros. |
11413 | 11417 |
11414 #endif // V8_OBJECTS_H_ | 11418 #endif // V8_OBJECTS_H_ |
OLD | NEW |