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

Unified Diff: extensions/renderer/safe_builtins.cc

Issue 1864733002: Prepare Chrome Extensions for ES2015 RegExp semantics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move comment Created 4 years, 8 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/resources/binding.js ('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 fbd88bdb15f3ee1278455b446159ecfcbc0386f7..b3e4f8425c0cebc72c47a8a4dc54e647715f33d8 100644
--- a/extensions/renderer/safe_builtins.cc
+++ b/extensions/renderer/safe_builtins.cc
@@ -79,8 +79,10 @@ const char kScript[] =
"saveBuiltin(String,\n"
" ['indexOf', 'slice', 'split', 'substr', 'toUpperCase',\n"
" 'replace']);\n"
+ "// Use exec rather than test to defend against clobbering in the\n"
+ "// presence of ES2015 semantics, which read RegExp.prototype.exec.\n"
"saveBuiltin(RegExp,\n"
- " ['test']);\n"
+ " ['exec']);\n"
"saveBuiltin(Error,\n"
" [],\n"
" ['captureStackTrace']);\n"
« no previous file with comments | « extensions/renderer/resources/binding.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698