| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index f7e1c746dd49f79fe31d6ffbb11aab5f24785557..c49ead268b0239cab2ae7a9107e7b36f09a31694 100644
|
| --- a/src/factory.cc
|
| +++ b/src/factory.cc
|
| @@ -600,6 +600,19 @@ MaybeHandle<String> Factory::NewConsString(Handle<String> left,
|
| return result;
|
| }
|
|
|
| +Handle<String> Factory::NewSurrogatePairString(uint16_t lead, uint16_t trail) {
|
| + DCHECK_GE(lead, 0xD800);
|
| + DCHECK_LE(lead, 0xDBFF);
|
| + DCHECK_GE(trail, 0xDC00);
|
| + DCHECK_LE(trail, 0xDFFF);
|
| +
|
| + Handle<SeqTwoByteString> str =
|
| + isolate()->factory()->NewRawTwoByteString(2).ToHandleChecked();
|
| + uc16* dest = str->GetChars();
|
| + dest[0] = lead;
|
| + dest[1] = trail;
|
| + return str;
|
| +}
|
|
|
| Handle<String> Factory::NewProperSubString(Handle<String> str,
|
| int begin,
|
| @@ -734,6 +747,17 @@ Handle<ExternalOneByteString> Factory::NewNativeSourceString(
|
| return external_string;
|
| }
|
|
|
| +Handle<JSStringIterator> Factory::NewJSStringIterator(Handle<String> string) {
|
| + Handle<Map> map(isolate()->native_context()->string_iterator_map(),
|
| + isolate());
|
| + Handle<String> flat_string = String::Flatten(string);
|
| + Handle<JSStringIterator> iterator =
|
| + Handle<JSStringIterator>::cast(NewJSObjectFromMap(map));
|
| + iterator->set_string(*flat_string);
|
| + iterator->set_index(0);
|
| +
|
| + return iterator;
|
| +}
|
|
|
| Handle<Symbol> Factory::NewSymbol() {
|
| CALL_HEAP_FUNCTION(
|
| @@ -1732,6 +1756,15 @@ Handle<JSDataView> Factory::NewJSDataView() {
|
| JSDataView);
|
| }
|
|
|
| +Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value,
|
| + bool done) {
|
| + Handle<Map> map(isolate()->native_context()->iterator_result_map());
|
| + Handle<JSIteratorResult> js_iter_result =
|
| + Handle<JSIteratorResult>::cast(NewJSObjectFromMap(map));
|
| + js_iter_result->set_value(*value);
|
| + js_iter_result->set_done(*ToBoolean(done));
|
| + return js_iter_result;
|
| +}
|
|
|
| Handle<JSMap> Factory::NewJSMap() {
|
| Handle<Map> map(isolate()->native_context()->js_map_map());
|
|
|