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 #include "src/factory.h" | 5 #include "src/factory.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 return NewError("MakeSyntaxError", message, args); | 1103 return NewError("MakeSyntaxError", message, args); |
1104 } | 1104 } |
1105 | 1105 |
1106 | 1106 |
1107 Handle<Object> Factory::NewSyntaxError(Handle<String> message) { | 1107 Handle<Object> Factory::NewSyntaxError(Handle<String> message) { |
1108 return NewError("$SyntaxError", message); | 1108 return NewError("$SyntaxError", message); |
1109 } | 1109 } |
1110 | 1110 |
1111 | 1111 |
1112 Handle<Object> Factory::NewReferenceError(const char* message, | 1112 Handle<Object> Factory::NewReferenceError(const char* message, |
1113 Vector<Handle<Object> > args) { | |
1114 return NewError("MakeReferenceError", message, args); | |
1115 } | |
1116 | |
1117 | |
1118 Handle<Object> Factory::NewReferenceError(const char* message, | |
1119 Handle<JSArray> args) { | 1113 Handle<JSArray> args) { |
1120 return NewError("MakeReferenceError", message, args); | 1114 return NewError("MakeReferenceError", message, args); |
1121 } | 1115 } |
1122 | 1116 |
1123 | 1117 |
1124 Handle<Object> Factory::NewReferenceError(Handle<String> message) { | 1118 Handle<Object> Factory::NewReferenceError(Handle<String> message) { |
1125 return NewError("$ReferenceError", message); | 1119 return NewError("$ReferenceError", message); |
1126 } | 1120 } |
1127 | 1121 |
1128 | 1122 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 if (exception.ToHandle(&exception_obj)) { | 1160 if (exception.ToHandle(&exception_obj)) { |
1167 result = exception_obj; | 1161 result = exception_obj; |
1168 } else { | 1162 } else { |
1169 result = undefined_value(); | 1163 result = undefined_value(); |
1170 } | 1164 } |
1171 } | 1165 } |
1172 return scope.CloseAndEscape(result); | 1166 return scope.CloseAndEscape(result); |
1173 } | 1167 } |
1174 | 1168 |
1175 | 1169 |
1176 Handle<Object> Factory::NewEvalError(const char* message, | |
1177 Vector<Handle<Object> > args) { | |
1178 return NewError("MakeEvalError", message, args); | |
1179 } | |
1180 | |
1181 | |
1182 Handle<Object> Factory::NewError(MessageTemplate::Template template_index, | 1170 Handle<Object> Factory::NewError(MessageTemplate::Template template_index, |
1183 Handle<Object> arg0, Handle<Object> arg1, | 1171 Handle<Object> arg0, Handle<Object> arg1, |
1184 Handle<Object> arg2) { | 1172 Handle<Object> arg2) { |
1185 return NewError("MakeError", template_index, arg0, arg1, arg2); | 1173 return NewError("MakeError", template_index, arg0, arg1, arg2); |
1186 } | 1174 } |
1187 | 1175 |
1188 | 1176 |
1189 Handle<Object> Factory::NewTypeError(MessageTemplate::Template template_index, | 1177 Handle<Object> Factory::NewTypeError(MessageTemplate::Template template_index, |
1190 Handle<Object> arg0, Handle<Object> arg1, | 1178 Handle<Object> arg0, Handle<Object> arg1, |
1191 Handle<Object> arg2) { | 1179 Handle<Object> arg2) { |
1192 return NewError("MakeTypeError", template_index, arg0, arg1, arg2); | 1180 return NewError("MakeTypeError", template_index, arg0, arg1, arg2); |
1193 } | 1181 } |
1194 | 1182 |
1195 | 1183 |
| 1184 Handle<Object> Factory::NewReferenceError( |
| 1185 MessageTemplate::Template template_index, Handle<Object> arg0, |
| 1186 Handle<Object> arg1, Handle<Object> arg2) { |
| 1187 return NewError("MakeReferenceError", template_index, arg0, arg1, arg2); |
| 1188 } |
| 1189 |
| 1190 |
1196 Handle<Object> Factory::NewRangeError(MessageTemplate::Template template_index, | 1191 Handle<Object> Factory::NewRangeError(MessageTemplate::Template template_index, |
1197 Handle<Object> arg0, Handle<Object> arg1, | 1192 Handle<Object> arg0, Handle<Object> arg1, |
1198 Handle<Object> arg2) { | 1193 Handle<Object> arg2) { |
1199 return NewError("MakeRangeError", template_index, arg0, arg1, arg2); | 1194 return NewError("MakeRangeError", template_index, arg0, arg1, arg2); |
1200 } | 1195 } |
1201 | 1196 |
1202 | 1197 |
1203 Handle<Object> Factory::NewEvalError(MessageTemplate::Template template_index, | 1198 Handle<Object> Factory::NewEvalError(MessageTemplate::Template template_index, |
1204 Handle<Object> arg0, Handle<Object> arg1, | 1199 Handle<Object> arg0, Handle<Object> arg1, |
1205 Handle<Object> arg2) { | 1200 Handle<Object> arg2) { |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2486 return Handle<Object>::null(); | 2481 return Handle<Object>::null(); |
2487 } | 2482 } |
2488 | 2483 |
2489 | 2484 |
2490 Handle<Object> Factory::ToBoolean(bool value) { | 2485 Handle<Object> Factory::ToBoolean(bool value) { |
2491 return value ? true_value() : false_value(); | 2486 return value ? true_value() : false_value(); |
2492 } | 2487 } |
2493 | 2488 |
2494 | 2489 |
2495 } } // namespace v8::internal | 2490 } } // namespace v8::internal |
OLD | NEW |