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

Unified Diff: src/bootstrapper.cc

Issue 1497483004: [proxies] Make Array.isArray respect proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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 | « no previous file | src/builtins.h » ('j') | 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 3f9c75d89a897d614c1e7c7cfd89156439bd9bfa..64b37256df24cde63e055b136588cbf499ba5581 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1014,6 +1014,20 @@ void Genesis::HookUpGlobalObject(Handle<JSGlobalObject> global_object) {
}
+static void SimpleInstallFunction(Handle<JSObject> base, Handle<Name> name,
+ Builtins::Name call, int len, bool adapt) {
+ Handle<JSFunction> fun =
+ InstallFunction(base, name, JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ MaybeHandle<JSObject>(), call, DONT_ENUM);
+ if (adapt) {
+ fun->shared()->set_internal_formal_parameter_count(len);
+ } else {
+ fun->shared()->DontAdaptArguments();
+ }
+ fun->shared()->set_length(len);
+}
+
+
// This is only called if we are not using snapshots. The equivalent
// work in the snapshot case is done in HookUpGlobalObject.
void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
@@ -1100,6 +1114,10 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Map::Copy(initial_map, "SetInstancePrototype");
initial_strong_map->set_is_strong();
CacheInitialJSArrayMaps(native_context(), initial_strong_map);
+
+ SimpleInstallFunction(array_function,
+ factory->NewStringFromAsciiChecked("isArray"),
+ Builtins::kArrayIsArray, 1, true);
}
{ // --- N u m b e r ---
@@ -1969,20 +1987,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind)
-static void SimpleInstallFunction(Handle<JSObject> base, Handle<Name> name,
- Builtins::Name call, int len, bool adapt) {
- Handle<JSFunction> fun =
- InstallFunction(base, name, JS_OBJECT_TYPE, JSObject::kHeaderSize,
- MaybeHandle<JSObject>(), call, DONT_ENUM);
- if (adapt) {
- fun->shared()->set_internal_formal_parameter_count(len);
- } else {
- fun->shared()->DontAdaptArguments();
- }
- fun->shared()->set_length(len);
-}
-
-
void InstallPublicSymbol(Factory* factory, Handle<Context> native_context,
const char* name, Handle<Symbol> value) {
Handle<JSGlobalObject> global(
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698