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

Unified Diff: src/bootstrapper.cc

Issue 259773009: Convert array.length to API-style accessor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
« no previous file with comments | « src/accessors.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 5101b87f8176c6f7d7073d9e07c99fb72e36fb36..33cdfcdd8e94f5ced77c97a618420879c0349061 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -863,12 +863,15 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
ASSERT(initial_map->elements_kind() == GetInitialFastElementsKind());
Map::EnsureDescriptorSlack(initial_map, 1);
- Handle<Foreign> array_length(factory->NewForeign(&Accessors::ArrayLength));
PropertyAttributes attribs = static_cast<PropertyAttributes>(
DONT_ENUM | DONT_DELETE);
+ Handle<AccessorInfo> array_length =
+ Accessors::ArrayLengthInfo(isolate, attribs);
{ // Add length.
- CallbacksDescriptor d(factory->length_string(), array_length, attribs);
+ CallbacksDescriptor d(
+ Handle<Name>(Name::cast(array_length->name())),
+ array_length, attribs);
array_function->initial_map()->AppendDescriptor(&d);
}
@@ -1614,14 +1617,14 @@ Handle<JSFunction> Genesis::InstallInternalArray(
// Make "length" magic on instances.
Map::EnsureDescriptorSlack(initial_map, 1);
- Handle<Foreign> array_length(factory()->NewForeign(
- &Accessors::ArrayLength));
PropertyAttributes attribs = static_cast<PropertyAttributes>(
DONT_ENUM | DONT_DELETE);
+ Handle<AccessorInfo> array_length =
+ Accessors::ArrayLengthInfo(isolate(), attribs);
{ // Add length.
CallbacksDescriptor d(
- factory()->length_string(), array_length, attribs);
+ Handle<Name>(Name::cast(array_length->name())), array_length, attribs);
array_function->initial_map()->AppendDescriptor(&d);
}
« no previous file with comments | « src/accessors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698