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

Unified Diff: src/accessors.cc

Issue 11417140: Censor .caller if it is a strict function instead of throwing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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 | « no previous file | test/mjsunit/strict-mode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 855ddb22b6731e7c59caadbcf90157678968ae40..a30bfd5e3c408e8afceb64e3c08ffae338ba21e6 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -649,19 +649,6 @@ const AccessorDescriptor Accessors::FunctionArguments = {
//
-static MaybeObject* CheckNonStrictCallerOrThrow(
- Isolate* isolate,
- JSFunction* caller) {
- DisableAssertNoAllocation enable_allocation;
- if (!caller->shared()->is_classic_mode()) {
- return isolate->Throw(
- *isolate->factory()->NewTypeError("strict_caller",
- HandleVector<Object>(NULL, 0)));
- }
- return caller;
-}
-
-
class FrameFunctionIterator {
public:
FrameFunctionIterator(Isolate* isolate, const AssertNoAllocation& promise)
@@ -748,7 +735,14 @@ MaybeObject* Accessors::FunctionGetCaller(Object* object, void*) {
if (caller->shared()->bound()) {
return isolate->heap()->null_value();
}
- return CheckNonStrictCallerOrThrow(isolate, caller);
+ // Censor if the caller is not a classic mode function.
+ // Change from ES5, which used to throw, see:
+ // https://bugs.ecmascript.org/show_bug.cgi?id=310
+ if (!caller->shared()->is_classic_mode()) {
+ return isolate->heap()->null_value();
+ }
+
+ return caller;
}
« no previous file with comments | « no previous file | test/mjsunit/strict-mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698