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

Side by Side Diff: src/objects.cc

Issue 1484393002: [runtime] Adding more detailed error message for Object::GetMethod. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing test error strings Created 5 years 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
« no previous file with comments | « src/messages.h ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 MaybeHandle<Object> Object::GetMethod(Handle<JSReceiver> receiver, 629 MaybeHandle<Object> Object::GetMethod(Handle<JSReceiver> receiver,
630 Handle<Name> name) { 630 Handle<Name> name) {
631 Handle<Object> func; 631 Handle<Object> func;
632 Isolate* isolate = receiver->GetIsolate(); 632 Isolate* isolate = receiver->GetIsolate();
633 ASSIGN_RETURN_ON_EXCEPTION(isolate, func, 633 ASSIGN_RETURN_ON_EXCEPTION(isolate, func,
634 JSReceiver::GetProperty(receiver, name), Object); 634 JSReceiver::GetProperty(receiver, name), Object);
635 if (func->IsNull() || func->IsUndefined()) { 635 if (func->IsNull() || func->IsUndefined()) {
636 return isolate->factory()->undefined_value(); 636 return isolate->factory()->undefined_value();
637 } 637 }
638 if (!func->IsCallable()) { 638 if (!func->IsCallable()) {
639 // TODO(bmeurer): Better error message here? 639 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kPropertyNotFunction,
640 THROW_NEW_ERROR(isolate, 640 func, name, receiver),
641 NewTypeError(MessageTemplate::kCalledNonCallable, func),
642 Object); 641 Object);
643 } 642 }
644 return func; 643 return func;
645 } 644 }
646 645
647 646
648 // static 647 // static
649 Maybe<bool> JSReceiver::HasProperty(LookupIterator* it) { 648 Maybe<bool> JSReceiver::HasProperty(LookupIterator* it) {
650 for (; it->IsFound(); it->Next()) { 649 for (; it->IsFound(); it->Next()) {
651 switch (it->state()) { 650 switch (it->state()) {
(...skipping 18357 matching lines...) Expand 10 before | Expand all | Expand 10 after
19009 if (cell->value() != *new_value) { 19008 if (cell->value() != *new_value) {
19010 cell->set_value(*new_value); 19009 cell->set_value(*new_value);
19011 Isolate* isolate = cell->GetIsolate(); 19010 Isolate* isolate = cell->GetIsolate();
19012 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19011 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19013 isolate, DependentCode::kPropertyCellChangedGroup); 19012 isolate, DependentCode::kPropertyCellChangedGroup);
19014 } 19013 }
19015 } 19014 }
19016 19015
19017 } // namespace internal 19016 } // namespace internal
19018 } // namespace v8 19017 } // namespace v8
OLDNEW
« no previous file with comments | « src/messages.h ('k') | test/cctest/test-strings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698