Chromium Code Reviews| Index: src/bootstrapper.cc |
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
| index 42a064c823aee39503716702bc1d4c0dd6886adc..3a147c7bca8139f025e9fc0915a7cf0e2a835103 100644 |
| --- a/src/bootstrapper.cc |
| +++ b/src/bootstrapper.cc |
| @@ -1440,9 +1440,17 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, |
| factory->NewStringFromAsciiChecked("String Iterator"), |
| static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
| - InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE, |
| - JSObject::kHeaderSize, MaybeHandle<JSObject>(), |
| - Builtins::kStringIteratorPrototypeNext); |
| + Handle<JSFunction> next = |
| + InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE, |
| + JSObject::kHeaderSize, MaybeHandle<JSObject>(), |
| + Builtins::kStringIteratorPrototypeNext); |
| + |
| + // Set the expected parameters for %StringIteratorPrototype%.next to 1; |
| + // required by builtin. |
| + next->shared()->set_internal_formal_parameter_count(0); |
|
Benedikt Meurer
2016/09/26 18:38:22
Comment says 1, but code says 0?
Also why not Sim
caitp
2016/09/27 08:55:56
AFAIK this intensionally does not include receiver
Benedikt Meurer
2016/09/27 08:58:54
Yes, but then the comment should say that it takes
caitp
2016/09/27 09:14:18
Done.
|
| + |
| + // Set the length for the function to satisfy ECMA-262. |
| + next->shared()->set_length(0); |
| Handle<JSFunction> string_iterator_function = CreateFunction( |
| isolate, factory->NewStringFromAsciiChecked("StringIterator"), |