Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: src/objects.cc

Issue 1408163005: [es6] Partially implement Reflect.getOwnPropertyDescriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 6558 matching lines...) Expand 10 before | Expand all | Expand 10 after
6569 isolate->Throw(*isolate->factory()->NewTypeError( 6569 isolate->Throw(*isolate->factory()->NewTypeError(
6570 MessageTemplate::kStrictDeleteProperty, 6570 MessageTemplate::kStrictDeleteProperty,
6571 isolate->factory()->NewNumberFromUint(actual_new_len - 1), a)); 6571 isolate->factory()->NewNumberFromUint(actual_new_len - 1), a));
6572 } 6572 }
6573 return success; 6573 return success;
6574 } 6574 }
6575 6575
6576 6576
6577 // static 6577 // static
6578 bool JSReceiver::GetOwnPropertyDescriptor(Isolate* isolate, 6578 bool JSReceiver::GetOwnPropertyDescriptor(Isolate* isolate,
6579 Handle<JSObject> object, 6579 Handle<JSReceiver> object,
6580 Handle<Object> key, 6580 Handle<Object> key,
6581 PropertyDescriptor* desc) { 6581 PropertyDescriptor* desc) {
6582 bool success = false; 6582 bool success = false;
6583 DCHECK(key->IsName() || key->IsNumber()); // |key| is a PropertyKey... 6583 DCHECK(key->IsName() || key->IsNumber()); // |key| is a PropertyKey...
6584 LookupIterator it = LookupIterator::PropertyOrElement( 6584 LookupIterator it = LookupIterator::PropertyOrElement(
6585 isolate, object, key, &success, LookupIterator::HIDDEN); 6585 isolate, object, key, &success, LookupIterator::HIDDEN);
6586 DCHECK(success); // ...so creating a LookupIterator can't fail. 6586 DCHECK(success); // ...so creating a LookupIterator can't fail.
6587 return GetOwnPropertyDescriptor(&it, desc); 6587 return GetOwnPropertyDescriptor(&it, desc);
6588 } 6588 }
6589 6589
(...skipping 11282 matching lines...) Expand 10 before | Expand all | Expand 10 after
17872 if (cell->value() != *new_value) { 17872 if (cell->value() != *new_value) {
17873 cell->set_value(*new_value); 17873 cell->set_value(*new_value);
17874 Isolate* isolate = cell->GetIsolate(); 17874 Isolate* isolate = cell->GetIsolate();
17875 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17875 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17876 isolate, DependentCode::kPropertyCellChangedGroup); 17876 isolate, DependentCode::kPropertyCellChangedGroup);
17877 } 17877 }
17878 } 17878 }
17879 17879
17880 } // namespace internal 17880 } // namespace internal
17881 } // namespace v8 17881 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698