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> NewURIError() { |
| 564 return NewError(isolate()->uri_error_function(), |
| 565 MessageTemplate::kURIMalformed); |
| 566 } |
| 567 |
563 Handle<Object> NewError(Handle<JSFunction> constructor, | 568 Handle<Object> NewError(Handle<JSFunction> constructor, |
564 MessageTemplate::Template template_index, | 569 MessageTemplate::Template template_index, |
565 Handle<Object> arg0 = Handle<Object>(), | 570 Handle<Object> arg0 = Handle<Object>(), |
566 Handle<Object> arg1 = Handle<Object>(), | 571 Handle<Object> arg1 = Handle<Object>(), |
567 Handle<Object> arg2 = Handle<Object>()); | 572 Handle<Object> arg2 = Handle<Object>()); |
568 | 573 |
569 #define DECLARE_ERROR(NAME) \ | 574 #define DECLARE_ERROR(NAME) \ |
570 Handle<Object> New##NAME(MessageTemplate::Template template_index, \ | 575 Handle<Object> New##NAME(MessageTemplate::Template template_index, \ |
571 Handle<Object> arg0 = Handle<Object>(), \ | 576 Handle<Object> arg0 = Handle<Object>(), \ |
572 Handle<Object> arg1 = Handle<Object>(), \ | 577 Handle<Object> arg1 = Handle<Object>(), \ |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 | 714 |
710 // Create a JSArray with no elements and no length. | 715 // Create a JSArray with no elements and no length. |
711 Handle<JSArray> NewJSArray(ElementsKind elements_kind, | 716 Handle<JSArray> NewJSArray(ElementsKind elements_kind, |
712 PretenureFlag pretenure = NOT_TENURED); | 717 PretenureFlag pretenure = NOT_TENURED); |
713 }; | 718 }; |
714 | 719 |
715 } // namespace internal | 720 } // namespace internal |
716 } // namespace v8 | 721 } // namespace v8 |
717 | 722 |
718 #endif // V8_FACTORY_H_ | 723 #endif // V8_FACTORY_H_ |
OLD | NEW |