OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
456 if (object->IsString() || object->IsNumber() || object->IsBoolean()) { | 456 if (object->IsString() || object->IsNumber() || object->IsBoolean()) { |
457 PrototypeIterator iter(isolate, object); | 457 PrototypeIterator iter(isolate, object); |
458 return Object::GetElement(isolate, PrototypeIterator::GetCurrent(iter), | 458 return Object::GetElement(isolate, PrototypeIterator::GetCurrent(iter), |
459 index); | 459 index); |
460 } else { | 460 } else { |
461 return Object::GetElement(isolate, object, index); | 461 return Object::GetElement(isolate, object, index); |
462 } | 462 } |
463 } | 463 } |
464 | 464 |
465 | 465 |
466 MUST_USE_RESULT | 466 MUST_USE_RESULT |
Igor Sheludko
2014/10/02 09:32:06
Remove MUST_USE_RESULT as it is already in the .h
Dmitry Lomov (no reviews)
2014/10/02 09:54:12
Done.
| |
467 static MaybeHandle<Name> ToName(Isolate* isolate, Handle<Object> key) { | 467 MaybeHandle<Name> Runtime::ToName(Isolate* isolate, Handle<Object> key) { |
468 if (key->IsName()) { | 468 if (key->IsName()) { |
469 return Handle<Name>::cast(key); | 469 return Handle<Name>::cast(key); |
470 } else { | 470 } else { |
471 Handle<Object> converted; | 471 Handle<Object> converted; |
472 ASSIGN_RETURN_ON_EXCEPTION(isolate, converted, | 472 ASSIGN_RETURN_ON_EXCEPTION(isolate, converted, |
473 Execution::ToString(isolate, key), Name); | 473 Execution::ToString(isolate, key), Name); |
474 return Handle<Name>::cast(converted); | 474 return Handle<Name>::cast(converted); |
475 } | 475 } |
476 } | 476 } |
477 | 477 |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1735 | 1735 |
1736 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) { | 1736 RUNTIME_FUNCTION(Runtime_ThrowReferenceError) { |
1737 HandleScope scope(isolate); | 1737 HandleScope scope(isolate); |
1738 DCHECK(args.length() == 1); | 1738 DCHECK(args.length() == 1); |
1739 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0); | 1739 CONVERT_ARG_HANDLE_CHECKED(Object, name, 0); |
1740 THROW_NEW_ERROR_RETURN_FAILURE( | 1740 THROW_NEW_ERROR_RETURN_FAILURE( |
1741 isolate, NewReferenceError("not_defined", HandleVector(&name, 1))); | 1741 isolate, NewReferenceError("not_defined", HandleVector(&name, 1))); |
1742 } | 1742 } |
1743 | 1743 |
1744 | 1744 |
1745 RUNTIME_FUNCTION(Runtime_ThrowNonMethodError) { | |
1746 HandleScope scope(isolate); | |
1747 DCHECK(args.length() == 0); | |
1748 THROW_NEW_ERROR_RETURN_FAILURE( | |
1749 isolate, NewReferenceError("non_method", HandleVector<Object>(NULL, 0))); | |
1750 } | |
1751 | |
1752 | |
1753 RUNTIME_FUNCTION(Runtime_ThrowUnsupportedSuperError) { | |
1754 HandleScope scope(isolate); | |
1755 DCHECK(args.length() == 0); | |
1756 THROW_NEW_ERROR_RETURN_FAILURE( | |
1757 isolate, | |
1758 NewReferenceError("unsupported_super", HandleVector<Object>(NULL, 0))); | |
1759 } | |
1760 | |
1761 | |
1762 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) { | 1745 RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) { |
1763 DCHECK(args.length() == 3); | 1746 DCHECK(args.length() == 3); |
1764 HandleScope scope(isolate); | 1747 HandleScope scope(isolate); |
1765 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 1748 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); |
1766 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 1749 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
1767 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); | 1750 CONVERT_BOOLEAN_ARG_CHECKED(debug_event, 2); |
1768 if (debug_event) isolate->debug()->OnPromiseReject(promise, value); | 1751 if (debug_event) isolate->debug()->OnPromiseReject(promise, value); |
1769 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); | 1752 Handle<Symbol> key = isolate->factory()->promise_has_handler_symbol(); |
1770 // Do not report if we actually have a handler. | 1753 // Do not report if we actually have a handler. |
1771 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) { | 1754 if (JSObject::GetDataProperty(promise, key)->IsUndefined()) { |
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3331 } | 3314 } |
3332 return NULL; | 3315 return NULL; |
3333 } | 3316 } |
3334 | 3317 |
3335 | 3318 |
3336 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 3319 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
3337 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 3320 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
3338 } | 3321 } |
3339 } | 3322 } |
3340 } // namespace v8::internal | 3323 } // namespace v8::internal |
OLD | NEW |