| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 839faae commit 801e61a
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | # Reset this number to 0 on major V8 upgrades. | |
| 29 | 29 | # Increment by one for each non-official patch applied to deps/v8. | |
| 30 | - 'v8_embedder_string': '-node.3', | ||
| 30 | + 'v8_embedder_string': '-node.4', | ||
| 31 | 31 | ||
| 32 | 32 | # Enable disassembler for `--print-code` v8 options | |
| 33 | 33 | 'v8_enable_disassembler': 1, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ class V8_EXPORT_PRIVATE LookupIterator final BASE_EMBEDDED { | |||
| 22 | 22 | kInterceptor = 1 << 0, | |
| 23 | 23 | kPrototypeChain = 1 << 1, | |
| 24 | 24 | ||
| 25 | - // Convience combinations of bits. | ||
| 25 | + // Convenience combinations of bits. | ||
| 26 | 26 | OWN_SKIP_INTERCEPTOR = 0, | |
| 27 | 27 | OWN = kInterceptor, | |
| 28 | 28 | PROTOTYPE_CHAIN_SKIP_INTERCEPTOR = kPrototypeChain, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6713,17 +6713,6 @@ Maybe<bool> JSReceiver::OrdinaryDefineOwnProperty(Isolate* isolate, | |||
| 6713 | 6713 | it.Next(); | |
| 6714 | 6714 | } | |
| 6715 | 6715 | ||
| 6716 | - // Handle interceptor | ||
| 6717 | - if (it.state() == LookupIterator::INTERCEPTOR) { | ||
| 6718 | - if (it.HolderIsReceiverOrHiddenPrototype()) { | ||
| 6719 | - Maybe<bool> result = DefinePropertyWithInterceptorInternal( | ||
| 6720 | - &it, it.GetInterceptor(), should_throw, *desc); | ||
| 6721 | - if (result.IsNothing() || result.FromJust()) { | ||
| 6722 | - return result; | ||
| 6723 | - } | ||
| 6724 | - } | ||
| 6725 | - } | ||
| 6726 | - | ||
| 6727 | 6716 | return OrdinaryDefineOwnProperty(&it, desc, should_throw); | |
| 6728 | 6717 | } | |
| 6729 | 6718 | ||
@@ -6739,6 +6728,20 @@ Maybe<bool> JSReceiver::OrdinaryDefineOwnProperty(LookupIterator* it, | |||
| 6739 | 6728 | PropertyDescriptor current; | |
| 6740 | 6729 | MAYBE_RETURN(GetOwnPropertyDescriptor(it, ¤t), Nothing<bool>()); | |
| 6741 | 6730 | ||
| 6731 | + it->Restart(); | ||
| 6732 | + // Handle interceptor | ||
| 6733 | + for (; it->IsFound(); it->Next()) { | ||
| 6734 | + if (it->state() == LookupIterator::INTERCEPTOR) { | ||
| 6735 | + if (it->HolderIsReceiverOrHiddenPrototype()) { | ||
| 6736 | + Maybe<bool> result = DefinePropertyWithInterceptorInternal( | ||
| 6737 | + it, it->GetInterceptor(), should_throw, *desc); | ||
| 6738 | + if (result.IsNothing() || result.FromJust()) { | ||
| 6739 | + return result; | ||
| 6740 | + } | ||
| 6741 | + } | ||
| 6742 | + } | ||
| 6743 | + } | ||
| 6744 | + | ||
| 6742 | 6745 | // TODO(jkummerow/verwaest): It would be nice if we didn't have to reset | |
| 6743 | 6746 | // the iterator every time. Currently, the reasons why we need it are: | |
| 6744 | 6747 | // - handle interceptors correctly | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -716,20 +716,21 @@ bool define_was_called_in_order = false; | |||
| 716 | 716 | void GetterCallbackOrder(Local<Name> property, | |
| 717 | 717 | const v8::PropertyCallbackInfo<v8::Value>& info) { | |
| 718 | 718 | get_was_called_in_order = true; | |
| 719 | - CHECK(define_was_called_in_order); | ||
| 719 | + CHECK(!define_was_called_in_order); | ||
| 720 | 720 | info.GetReturnValue().Set(property); | |
| 721 | 721 | } | |
| 722 | 722 | ||
| 723 | 723 | void DefinerCallbackOrder(Local<Name> property, | |
| 724 | 724 | const v8::PropertyDescriptor& desc, | |
| 725 | 725 | const v8::PropertyCallbackInfo<v8::Value>& info) { | |
| 726 | - CHECK(!get_was_called_in_order); // Define called before get. | ||
| 726 | + // Get called before DefineProperty because we query the descriptor first. | ||
| 727 | + CHECK(get_was_called_in_order); | ||
| 727 | 728 | define_was_called_in_order = true; | |
| 728 | 729 | } | |
| 729 | 730 | ||
| 730 | 731 | } // namespace | |
| 731 | 732 | ||
| 732 | - // Check that definer callback is called before getter callback. | ||
| 733 | + // Check that getter callback is called before definer callback. | ||
| 733 | 734 | THREADED_TEST(DefinerCallbackGetAndDefine) { | |
| 734 | 735 | v8::HandleScope scope(CcTest::isolate()); | |
| 735 | 736 | v8::Local<v8::FunctionTemplate> templ = | |
| Back | FazBrowse Home | New Git URL |
0 commit comments