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

Unified Diff: src/runtime/runtime-internal.cc

Issue 2389233002: [regexp] Port RegExp getters and setters (Closed)
Patch Set: Handle Smi receivers Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« src/builtins/builtins-regexp.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index 26882b5c83b08896152142eaabc83485c339778e..b7974bcf0970f303fcf1ab230ce1dec45058199f 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -100,6 +100,23 @@ RUNTIME_FUNCTION(Runtime_ThrowStackOverflow) {
return isolate->StackOverflow();
}
+RUNTIME_FUNCTION(Runtime_ThrowTypeError) {
+ HandleScope scope(isolate);
+ DCHECK_LE(1, args.length());
+ CONVERT_SMI_ARG_CHECKED(message_id_smi, 0);
+
+ Handle<Object> undefined = isolate->factory()->undefined_value();
+ Handle<Object> arg0 = (args.length() > 1) ? args.at<Object>(1) : undefined;
+ Handle<Object> arg1 = (args.length() > 2) ? args.at<Object>(2) : undefined;
+ Handle<Object> arg2 = (args.length() > 3) ? args.at<Object>(3) : undefined;
+
+ MessageTemplate::Template message_id =
+ static_cast<MessageTemplate::Template>(message_id_smi);
+
+ THROW_NEW_ERROR_RETURN_FAILURE(isolate,
+ NewTypeError(message_id, arg0, arg1, arg2));
+}
+
RUNTIME_FUNCTION(Runtime_ThrowWasmError) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
« src/builtins/builtins-regexp.cc ('K') | « src/runtime/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698