The old code did not work correctly in case of optimizations. I
found this out when implementing concise methods and we now plumb
through the function kind so we know what kind of Map to create for
the function.
BUG=v8:2700
LOG=y
R=rossberg@chromium.org
Review URL: https://codereview.chromium.org/
562253002
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23920
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
: STRICT_GENERATOR_FUNCTION_MAP_INDEX;
}
- if (IsConciseMethod(kind)) {
+ if (IsArrowFunction(kind) || IsConciseMethod(kind)) {
return strict_mode == SLOPPY
? SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX
: STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
function->set_prototype_or_initial_map(*the_hole_value());
function->set_literals_or_bindings(*empty_fixed_array());
function->set_next_function_link(*undefined_value());
-
- // TODO(arv): This does not look correct. We need to make sure we use
- // a Map that has no prototype property.
- if (info->is_arrow()) function->RemovePrototype();
}
// "new" operator on them.
assertEquals("function", typeof (() => {}));
assertEquals(Function.prototype, Object.getPrototypeOf(() => {}));
-assertThrows("new (() => {})", TypeError);
+assertThrows(function() { new (() => {}); }, TypeError);
+assertFalse("prototype" in (() => {}));
// Check the different syntax variations
assertEquals(1, (() => 1)());