| Index: src/contexts.h
|
| diff --git a/src/contexts.h b/src/contexts.h
|
| index 28e4af53682b2fa6a55623914720d7939bbd0285..378185f947331b29dcd929746ca96dfed84381cf 100644
|
| --- a/src/contexts.h
|
| +++ b/src/contexts.h
|
| @@ -344,9 +344,13 @@ class Context: public FixedArray {
|
| // Compute the native context by traversing the context chain.
|
| Context* native_context();
|
|
|
| - // Predicates for context types. IsNativeContext is defined on Object
|
| + // Predicates for context types. IsNativeContext is also defined on Object
|
| // because we frequently have to know if arbitrary objects are natives
|
| // contexts.
|
| + bool IsNativeContext() {
|
| + Map* map = this->map();
|
| + return map == map->GetHeap()->native_context_map();
|
| + }
|
| bool IsFunctionContext() {
|
| Map* map = this->map();
|
| return map == map->GetHeap()->function_context_map();
|
|
|