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" |