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); |
} |