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

Unified Diff: extensions/renderer/safe_builtins.cc

Issue 482603002: Unify logic of stack trace generation for extension errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update expected stack trace length Created 6 years, 4 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
« no previous file with comments | « extensions/renderer/safe_builtins.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/safe_builtins.cc
diff --git a/extensions/renderer/safe_builtins.cc b/extensions/renderer/safe_builtins.cc
index 1f32aafcc68d4a87c6ed48cd1f4ae23f27a6ffe3..44a7d7f69d0090aaed61f8e92e00386b4faa853c 100644
--- a/extensions/renderer/safe_builtins.cc
+++ b/extensions/renderer/safe_builtins.cc
@@ -41,7 +41,7 @@ const char kScript[] =
" var firstArgIndex = 0;\n"
" if (!isStatic) {\n"
" if (arguments.length == 0)\n"
- " throw 'There must be at least one argument, the recevier';\n"
+ " throw 'There must be at least one argument, the receiver';\n"
" recv = arguments[0];\n"
" firstArgIndex = 1;\n"
" }\n"
@@ -63,7 +63,7 @@ const char kScript[] =
" Save(builtin.name, safe);\n"
"}\n"
"\n"
- "// Save only what is needed to make tests that override builtins pass.\n"
+ "// Save only what is needed by the extension modules.\n"
"saveBuiltin(Object,\n"
" ['hasOwnProperty'],\n"
" ['create', 'defineProperty', 'getOwnPropertyDescriptor',\n"
@@ -74,9 +74,12 @@ const char kScript[] =
" ['concat', 'forEach', 'indexOf', 'join', 'push', 'slice',\n"
" 'splice', 'map', 'filter']);\n"
"saveBuiltin(String,\n"
- " ['slice', 'split']);\n"
+ " ['indexOf', 'slice', 'split']);\n"
"saveBuiltin(RegExp,\n"
" ['test']);\n"
+ "saveBuiltin(Error,\n"
+ " [],\n"
+ " ['captureStackTrace']);\n"
"\n"
"// JSON is trickier because extensions can override toJSON in\n"
"// incompatible ways, and we need to prevent that.\n"
@@ -230,4 +233,8 @@ v8::Local<v8::Object> SafeBuiltins::GetString() const {
return Load("String", context_->v8_context());
}
+v8::Local<v8::Object> SafeBuiltins::GetError() const {
+ return Load("Error", context_->v8_context());
+}
+
} // namespace extensions
« no previous file with comments | « extensions/renderer/safe_builtins.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698