Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 36d6ea870c493945536ed49df2ee99917782442b..96e767f9fba1419773166afa415d1a0026c2053a 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -15988,6 +15988,12 @@ void JSObject::CollectOwnPropertyNames(KeyAccumulator* keys, |
} |
} |
+bool JSObject::WasConstructedFromApiFunction() { |
Toon Verwaest
2016/04/06 14:07:47
can't we now just check == JS_API... || JS_SPECIAL
Marcel Hlopko
2016/04/07 08:09:53
Yes indeed. I left the slow path hidden behind FLA
|
+ Object* maybe_constructor = map()->GetConstructor(); |
+ if (!maybe_constructor->IsJSFunction()) return false; |
+ JSFunction* constructor = JSFunction::cast(maybe_constructor); |
+ return constructor->shared()->IsApiFunction(); |
+} |
int JSObject::NumberOfOwnElements(PropertyFilter filter) { |
// Fast case for objects with no elements. |