OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1433 | 1433 |
1434 Handle<JSObject> string_iterator_prototype = | 1434 Handle<JSObject> string_iterator_prototype = |
1435 factory->NewJSObject(isolate->object_function(), TENURED); | 1435 factory->NewJSObject(isolate->object_function(), TENURED); |
1436 JSObject::ForceSetPrototype(string_iterator_prototype, iterator_prototype); | 1436 JSObject::ForceSetPrototype(string_iterator_prototype, iterator_prototype); |
1437 | 1437 |
1438 JSObject::AddProperty( | 1438 JSObject::AddProperty( |
1439 string_iterator_prototype, factory->to_string_tag_symbol(), | 1439 string_iterator_prototype, factory->to_string_tag_symbol(), |
1440 factory->NewStringFromAsciiChecked("String Iterator"), | 1440 factory->NewStringFromAsciiChecked("String Iterator"), |
1441 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 1441 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
1442 | 1442 |
1443 InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE, | 1443 Handle<JSFunction> next = |
1444 JSObject::kHeaderSize, MaybeHandle<JSObject>(), | 1444 InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE, |
1445 Builtins::kStringIteratorPrototypeNext); | 1445 JSObject::kHeaderSize, MaybeHandle<JSObject>(), |
1446 Builtins::kStringIteratorPrototypeNext); | |
1447 | |
1448 // Set the expected parameters for %StringIteratorPrototype%.next to 1; | |
1449 // required by builtin. | |
1450 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.
| |
1451 | |
1452 // Set the length for the function to satisfy ECMA-262. | |
1453 next->shared()->set_length(0); | |
1446 | 1454 |
1447 Handle<JSFunction> string_iterator_function = CreateFunction( | 1455 Handle<JSFunction> string_iterator_function = CreateFunction( |
1448 isolate, factory->NewStringFromAsciiChecked("StringIterator"), | 1456 isolate, factory->NewStringFromAsciiChecked("StringIterator"), |
1449 JS_STRING_ITERATOR_TYPE, JSStringIterator::kSize, | 1457 JS_STRING_ITERATOR_TYPE, JSStringIterator::kSize, |
1450 string_iterator_prototype, Builtins::kIllegal); | 1458 string_iterator_prototype, Builtins::kIllegal); |
1451 native_context()->set_string_iterator_map( | 1459 native_context()->set_string_iterator_map( |
1452 string_iterator_function->initial_map()); | 1460 string_iterator_function->initial_map()); |
1453 } | 1461 } |
1454 | 1462 |
1455 { | 1463 { |
(...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4185 } | 4193 } |
4186 | 4194 |
4187 | 4195 |
4188 // Called when the top-level V8 mutex is destroyed. | 4196 // Called when the top-level V8 mutex is destroyed. |
4189 void Bootstrapper::FreeThreadResources() { | 4197 void Bootstrapper::FreeThreadResources() { |
4190 DCHECK(!IsActive()); | 4198 DCHECK(!IsActive()); |
4191 } | 4199 } |
4192 | 4200 |
4193 } // namespace internal | 4201 } // namespace internal |
4194 } // namespace v8 | 4202 } // namespace v8 |
OLD | NEW |