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

Unified Diff: src/contexts.h

Issue 1027283004: [es6] do not add caller/arguments to ES6 function definitions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + test262 exceptions 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
Index: src/contexts.h
diff --git a/src/contexts.h b/src/contexts.h
index 3b4b7992c099bbc5f7393fc37d7fa5549284e119..3862f0c631119789b02b1b39cd5b350a66ddc986 100644
--- a/src/contexts.h
+++ b/src/contexts.h
@@ -582,17 +582,18 @@ class Context: public FixedArray {
}
if (IsConstructor(kind)) {
- return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX :
- is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX
- : SLOPPY_FUNCTION_MAP_INDEX;
+ // Use strict function map (no own "caller" / "arguments")
+ return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX
+ : STRICT_FUNCTION_MAP_INDEX;
}
if (IsArrowFunction(kind) || IsConciseMethod(kind) ||
IsAccessorFunction(kind)) {
- return is_strong(language_mode) ? STRONG_FUNCTION_MAP_INDEX :
- is_strict(language_mode) ?
- STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX :
- SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
+ return is_strong(language_mode)
+ ? STRONG_FUNCTION_MAP_INDEX
+ : is_strict(language_mode) || !IsAccessorFunction(kind)
arv (Not doing code reviews) 2015/04/07 16:18:39 I don't understand why accessor functions are spec
caitp (gmail) 2015/04/07 16:29:57 It was to avoid breaking the old behaviour. But I
arv (Not doing code reviews) 2015/04/07 17:00:11 Accessors are considered Methods in ES6 so they ha
caitp (gmail) 2015/04/07 17:10:36 Oh I see what you're saying. So I guess I was tryi
arv (Not doing code reviews) 2015/04/07 18:22:03 I think sloppy accessors should be treated as slop
+ ? STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX
+ : SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
}
return is_strong(language_mode) ? STRONG_FUNCTION_MAP_INDEX :

Powered by Google App Engine
This is Rietveld 408576698