| Index: src/contexts.h
|
| diff --git a/src/contexts.h b/src/contexts.h
|
| index 592b548cb6d226ed02cba48d2b325e30ef249286..745ba65347e4303ce15e96eacf1feda004c2d169 100644
|
| --- a/src/contexts.h
|
| +++ b/src/contexts.h
|
| @@ -351,9 +351,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();
|
|
|