Changeset 235582 in webkit


Ignore:
Timestamp:
Sep 1, 2018 1:03:43 AM (6 years ago)
Author:
yusukesuzuki@slowstart.org
Message:

Function object should convert params to string before throw a parsing error
https://bugs.webkit.org/show_bug.cgi?id=188874

Reviewed by Darin Adler.

JSTests:

  • stress/function-body-to-string-before-parameter-syntax-check.js: Added.

(shouldThrow):

Source/JavaScriptCore:

ToString operation onto the body of the Function constructor should be performed
before checking syntax correctness of the parameters.

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunctionSkippingEvalEnabledCheck):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r235558 r235582  
     12018-08-24  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
     2
     3        Function object should convert params to string before throw a parsing error
     4        https://bugs.webkit.org/show_bug.cgi?id=188874
     5
     6        Reviewed by Darin Adler.
     7
     8        * stress/function-body-to-string-before-parameter-syntax-check.js: Added.
     9        (shouldThrow):
     10
    1112018-08-31  Mark Lam  <mark.lam@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r235558 r235582  
     12018-08-24  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
     2
     3        Function object should convert params to string before throw a parsing error
     4        https://bugs.webkit.org/show_bug.cgi?id=188874
     5
     6        Reviewed by Darin Adler.
     7
     8        ToString operation onto the `body` of the Function constructor should be performed
     9        before checking syntax correctness of the parameters.
     10
     11        * runtime/FunctionConstructor.cpp:
     12        (JSC::constructFunctionSkippingEvalEnabledCheck):
     13
    1142018-08-31  Mark Lam  <mark.lam@apple.com>
    215
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r232337 r235582  
    140140            parameterBuilder.append(viewWithString.view);
    141141        }
     142        auto body = args.at(args.size() - 1).toWTFString(exec);
     143        RETURN_IF_EXCEPTION(scope, nullptr);
    142144
    143145        {
     
    156158        builder.append(parameterBuilder);
    157159        builder.appendLiteral(") {\n");
    158         auto body = args.at(args.size() - 1).toWTFString(exec);
    159         RETURN_IF_EXCEPTION(scope, nullptr);
    160160        checkBody(body);
    161161        RETURN_IF_EXCEPTION(scope, nullptr);
Note: See TracChangeset for help on using the changeset viewer.