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

Unified Diff: src/collection.js

Issue 1116003005: Remove GetDefaultReceiver, pass in undefined to sloppy-mode functions instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make sure it does TO_OBJECT Created 5 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 | « src/array.js ('k') | src/harmony-array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/collection.js
diff --git a/src/collection.js b/src/collection.js
index 206aaa79134709b0a1a1c67c98646e73cccd9ffe..d0d03c4586acde98c8794d0dc804a8fee05dbed7 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -209,9 +209,9 @@ function SetForEach(f, receiver) {
if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
- if (IS_NULL_OR_UNDEFINED(receiver)) {
- receiver = %GetDefaultReceiver(f) || receiver;
- } else {
+ if (IS_NULL(receiver)) {
+ if (%IsSloppyModeFunction(f)) receiver = UNDEFINED;
+ } else if (!IS_UNDEFINED(receiver)) {
needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver);
}
@@ -399,9 +399,9 @@ function MapForEach(f, receiver) {
if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
- if (IS_NULL_OR_UNDEFINED(receiver)) {
- receiver = %GetDefaultReceiver(f) || receiver;
- } else {
+ if (IS_NULL(receiver)) {
+ if (%IsSloppyModeFunction(f)) receiver = UNDEFINED;
+ } else if (!IS_UNDEFINED(receiver)) {
needs_wrapper = SHOULD_CREATE_WRAPPER(f, receiver);
}
« no previous file with comments | « src/array.js ('k') | src/harmony-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698