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

Unified Diff: src/v8natives.js

Issue 8333019: Make bound functions have poisoned .caller and .arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
« no previous file with comments | « src/ic.cc ('k') | test/mjsunit/function-bind.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index de80067866b3e95d878b9452d7e0eb8fd9ac202c..337349cad944b7443e36d01b4054c6b09c730a17 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1520,6 +1520,8 @@ function FunctionBind(this_arg) { // Length is 1.
throw new $TypeError('Bind must be called on a function');
}
var boundFunction = function () {
+ // Poison .arguments and .caller, but is otherwise not detectable.
+ "use strict";
// This function must not use any object literals (Object, Array, RegExp),
// since the literals-array is being used to store the bound data.
if (%_IsConstructCall()) {
« no previous file with comments | « src/ic.cc ('k') | test/mjsunit/function-bind.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698