Ignore:
Timestamp:
Nov 18, 2016, 10:57:17 AM (9 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Generator functions should have a displayable name when shown in stack traces
https://bugs.webkit.org/show_bug.cgi?id=164844
<rdar://problem/29300697>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/generator-function-name.js:

Add another test now that we name the inner generator function
that we do not break the lexical resolution of names.

Source/JavaScriptCore:

  • parser/SyntaxChecker.h:

(JSC::SyntaxChecker::createGeneratorFunctionBody):

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::createGeneratorFunctionBody):
New way to create a generator function with an inferred name.

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):

  • parser/Parser.h:

Pass on the name of the generator wrapper function so we can
use it on the inner generator function.

LayoutTests:

  • inspector/debugger/js-stacktrace-expected.txt:
  • inspector/debugger/js-stacktrace.html:

Add a test case for console.trace() / Error stack inside of generators.
Modernize the test to reduce redundency and get nicer output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SyntaxChecker.h

    r207228 r208885  
    185185    ClassExpression createClassExpr(const JSTokenLocation&, const ParserClassInfo<SyntaxChecker>&, VariableEnvironment&, ExpressionType, ExpressionType, PropertyList, PropertyList) { return ClassExpr; }
    186186    ExpressionType createFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
     187    ExpressionType createGeneratorFunctionBody(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&, const Identifier&) { return FunctionExpr; }
    187188    ExpressionType createAsyncFunctionBody(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
    188189    int createFunctionMetadata(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, SuperBinding, unsigned, int, SourceParseMode, bool, InnerArrowFunctionCodeFeatures = NoInnerArrowFunctionFeatures) { return FunctionBodyResult; }
Note: See TracChangeset for help on using the changeset viewer.