haikuwebkit/LayoutTests/js/arrowfunction-lexical-bind-...

11 lines
280 B
HTML
Raw Permalink Normal View History

[ES6] Arrow function syntax. Arrow function specific features. Lexical bind "arguments" https://bugs.webkit.org/show_bug.cgi?id=145132 Patch by Skachkov Oleksandr <gskachkov@gmail.com> on 2016-01-25 Reviewed by Saam Barati. Source/JavaScriptCore: Added support of ES6 arrow function specific feature, lexical bind of arguments. http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions-runtime-semantics-evaluation 'arguments' variable in arrow function must resolve to a binding in a lexically enclosing environment. In srict mode it points to arguments object, and in non-stric mode it points to arguments object or varible with name 'arguments' if it was declared. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): * parser/Parser.h: (JSC::Scope::Scope): (JSC::Scope::setSourceParseMode): (JSC::Scope::isArrowFunction): (JSC::Scope::collectFreeVariables): (JSC::Scope::setIsArrowFunction): * tests/es6.yaml: * tests/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js: Added. * tests/stress/arrowfunction-lexical-bind-arguments-non-strict-2.js: Added. * tests/stress/arrowfunction-lexical-bind-arguments-strict.js: Added. Source/WebInspectorUI: Current patch is implementing lexical bind of arguments, so in this callback we need to return to ordinary function. * UserInterface/Base/Object.js: (WebInspector.Object.singleFireEventListener.let.wrappedCallback): (WebInspector.Object.singleFireEventListener): LayoutTests: * js/arrowfunction-lexical-bind-arguments-non-strict-expected.txt: Added. * js/arrowfunction-lexical-bind-arguments-non-strict.html: Added. * js/arrowfunction-lexical-bind-arguments-strict-expected.txt: Added. * js/arrowfunction-lexical-bind-arguments-strict.html: Added. * js/script-tests/arrowfunction-lexical-bind-arguments-non-strict.js: Added. * js/script-tests/arrowfunction-lexical-bind-arguments-strict.js: Added. Canonical link: https://commits.webkit.org/171535@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-26 05:43:11 +00:00
<DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script src="script-tests/arrowfunction-lexical-bind-arguments-strict.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>