Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_FACTORY_H_ | 5 #ifndef V8_FACTORY_H_ |
| 6 #define V8_FACTORY_H_ | 6 #define V8_FACTORY_H_ |
| 7 | 7 |
| 8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 #include "src/type-feedback-vector.h" | 10 #include "src/type-feedback-vector.h" |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 553 Handle<BytecodeArray> CopyBytecodeArray(Handle<BytecodeArray>); | 553 Handle<BytecodeArray> CopyBytecodeArray(Handle<BytecodeArray>); |
| 554 | 554 |
| 555 // Interface for creating error objects. | 555 // Interface for creating error objects. |
| 556 Handle<Object> NewError(Handle<JSFunction> constructor, | 556 Handle<Object> NewError(Handle<JSFunction> constructor, |
| 557 Handle<String> message); | 557 Handle<String> message); |
| 558 | 558 |
| 559 Handle<Object> NewInvalidStringLengthError() { | 559 Handle<Object> NewInvalidStringLengthError() { |
| 560 return NewRangeError(MessageTemplate::kInvalidStringLength); | 560 return NewRangeError(MessageTemplate::kInvalidStringLength); |
| 561 } | 561 } |
| 562 | 562 |
| 563 Handle<Object> NewMakeURIError() { | |
|
Yang
2016/05/12 07:39:20
Can we call this NewURIError and have it call into
Franzi
2016/05/13 09:42:02
Done.
| |
| 564 return NewURIError(MessageTemplate::kURIMalformed); | |
| 565 } | |
| 566 | |
| 563 Handle<Object> NewError(Handle<JSFunction> constructor, | 567 Handle<Object> NewError(Handle<JSFunction> constructor, |
| 564 MessageTemplate::Template template_index, | 568 MessageTemplate::Template template_index, |
| 565 Handle<Object> arg0 = Handle<Object>(), | 569 Handle<Object> arg0 = Handle<Object>(), |
| 566 Handle<Object> arg1 = Handle<Object>(), | 570 Handle<Object> arg1 = Handle<Object>(), |
| 567 Handle<Object> arg2 = Handle<Object>()); | 571 Handle<Object> arg2 = Handle<Object>()); |
| 568 | 572 |
| 569 #define DECLARE_ERROR(NAME) \ | 573 #define DECLARE_ERROR(NAME) \ |
| 570 Handle<Object> New##NAME(MessageTemplate::Template template_index, \ | 574 Handle<Object> New##NAME(MessageTemplate::Template template_index, \ |
| 571 Handle<Object> arg0 = Handle<Object>(), \ | 575 Handle<Object> arg0 = Handle<Object>(), \ |
| 572 Handle<Object> arg1 = Handle<Object>(), \ | 576 Handle<Object> arg1 = Handle<Object>(), \ |
| 573 Handle<Object> arg2 = Handle<Object>()); | 577 Handle<Object> arg2 = Handle<Object>()); |
| 574 DECLARE_ERROR(Error) | 578 DECLARE_ERROR(Error) |
| 575 DECLARE_ERROR(EvalError) | 579 DECLARE_ERROR(EvalError) |
| 576 DECLARE_ERROR(RangeError) | 580 DECLARE_ERROR(RangeError) |
| 577 DECLARE_ERROR(ReferenceError) | 581 DECLARE_ERROR(ReferenceError) |
| 578 DECLARE_ERROR(SyntaxError) | 582 DECLARE_ERROR(SyntaxError) |
| 579 DECLARE_ERROR(TypeError) | 583 DECLARE_ERROR(TypeError) |
| 584 DECLARE_ERROR(URIError) | |
|
Yang
2016/05/12 07:39:20
Let's not declare this helper.
Franzi
2016/05/13 09:42:02
Done.
| |
| 585 | |
| 580 #undef DEFINE_ERROR | 586 #undef DEFINE_ERROR |
| 581 | 587 |
| 582 Handle<String> NumberToString(Handle<Object> number, | 588 Handle<String> NumberToString(Handle<Object> number, |
| 583 bool check_number_string_cache = true); | 589 bool check_number_string_cache = true); |
| 584 | 590 |
| 585 Handle<String> Uint32ToString(uint32_t value) { | 591 Handle<String> Uint32ToString(uint32_t value) { |
| 586 return NumberToString(NewNumberFromUint(value)); | 592 return NumberToString(NewNumberFromUint(value)); |
| 587 } | 593 } |
| 588 | 594 |
| 589 Handle<JSFunction> InstallMembers(Handle<JSFunction> function); | 595 Handle<JSFunction> InstallMembers(Handle<JSFunction> function); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 709 | 715 |
| 710 // Create a JSArray with no elements and no length. | 716 // Create a JSArray with no elements and no length. |
| 711 Handle<JSArray> NewJSArray(ElementsKind elements_kind, | 717 Handle<JSArray> NewJSArray(ElementsKind elements_kind, |
| 712 PretenureFlag pretenure = NOT_TENURED); | 718 PretenureFlag pretenure = NOT_TENURED); |
| 713 }; | 719 }; |
| 714 | 720 |
| 715 } // namespace internal | 721 } // namespace internal |
| 716 } // namespace v8 | 722 } // namespace v8 |
| 717 | 723 |
| 718 #endif // V8_FACTORY_H_ | 724 #endif // V8_FACTORY_H_ |
| OLD | NEW |