| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/contexts.h" | 5 #include "src/contexts.h" |
| 6 | 6 |
| 7 #include "src/ast/scopeinfo.h" | 7 #include "src/ast/scopeinfo.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // to only do a local lookup for context extension objects. | 284 // to only do a local lookup for context extension objects. |
| 285 Maybe<PropertyAttributes> maybe = Nothing<PropertyAttributes>(); | 285 Maybe<PropertyAttributes> maybe = Nothing<PropertyAttributes>(); |
| 286 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || | 286 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || |
| 287 object->IsJSContextExtensionObject()) { | 287 object->IsJSContextExtensionObject()) { |
| 288 maybe = JSReceiver::GetOwnPropertyAttributes(object, name); | 288 maybe = JSReceiver::GetOwnPropertyAttributes(object, name); |
| 289 } else if (context->IsWithContext()) { | 289 } else if (context->IsWithContext()) { |
| 290 // A with context will never bind "this". | 290 // A with context will never bind "this". |
| 291 if (name->Equals(*isolate->factory()->this_string())) { | 291 if (name->Equals(*isolate->factory()->this_string())) { |
| 292 maybe = Just(ABSENT); | 292 maybe = Just(ABSENT); |
| 293 } else { | 293 } else { |
| 294 LookupIterator it(object, name); | 294 LookupIterator it(object, name, object); |
| 295 Maybe<bool> found = UnscopableLookup(&it); | 295 Maybe<bool> found = UnscopableLookup(&it); |
| 296 if (found.IsNothing()) { | 296 if (found.IsNothing()) { |
| 297 maybe = Nothing<PropertyAttributes>(); | 297 maybe = Nothing<PropertyAttributes>(); |
| 298 } else { | 298 } else { |
| 299 // Luckily, consumers of |maybe| only care whether the property | 299 // Luckily, consumers of |maybe| only care whether the property |
| 300 // was absent or not, so we can return a dummy |NONE| value | 300 // was absent or not, so we can return a dummy |NONE| value |
| 301 // for its attributes when it was present. | 301 // for its attributes when it was present. |
| 302 maybe = Just(found.FromJust() ? NONE : ABSENT); | 302 maybe = Just(found.FromJust() ? NONE : ABSENT); |
| 303 } | 303 } |
| 304 } | 304 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 580 |
| 581 int previous_value = errors_thrown()->value(); | 581 int previous_value = errors_thrown()->value(); |
| 582 set_errors_thrown(Smi::FromInt(previous_value + 1)); | 582 set_errors_thrown(Smi::FromInt(previous_value + 1)); |
| 583 } | 583 } |
| 584 | 584 |
| 585 | 585 |
| 586 int Context::GetErrorsThrown() { return errors_thrown()->value(); } | 586 int Context::GetErrorsThrown() { return errors_thrown()->value(); } |
| 587 | 587 |
| 588 } // namespace internal | 588 } // namespace internal |
| 589 } // namespace v8 | 589 } // namespace v8 |
| OLD | NEW |