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

Unified Diff: src/builtins.cc

Issue 131663003: Make the strict-mode calling convention for contextual calls the default one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix arm port Created 6 years, 11 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/arm/stub-cache-arm.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 919126363031ca70554a9b141e7b4ff5793ebb0f..a690b31b29d923c3bc4d38c1f6e9dd44167f833a 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1173,6 +1173,15 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallHelper(
fun_data = *desc;
}
+ SharedFunctionInfo* shared = function->shared();
+ if (shared->is_classic_mode() && !shared->native()) {
+ Object* recv = args[0];
+ ASSERT(!recv->IsNull());
+ if (recv->IsUndefined()) {
+ args[0] = function->context()->global_object()->global_receiver();
+ }
+ }
+
Object* raw_holder = TypeCheck(heap, args.length(), &args[0], fun_data);
if (raw_holder->IsNull()) {
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698