summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/object/prop-def-invalid-async-prefix.js
blob: b5c846b643844f9b61360291a15d75cb26447a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// |reftest| error:SyntaxError
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
  async is not a valid prefix of an identifier reference
esid: sec-object-initializer
info: |
    PropertyDefinition:
      IdentifierReference
      CoverInitializedName
      PropertyName : AssignmentExpression
      MethodDefinition

    MethodDefinition:
      PropertyName ( UniqueFormalParameters ) { FunctionBody }
      AsyncMethod

    AsyncMethod:
      async [no LineTerminator here] PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
      VariableDeclaration : BindingPattern Initializer

      1. Let rhs be the result of evaluating Initializer.
      2. Let rval be GetValue(rhs).
      3. ReturnIfAbrupt(rval).
      4. Return the result of performing BindingInitialization for
         BindingPattern passing rval and undefined as arguments.
negative:
  phase: parse
  type: SyntaxError
---*/

$DONOTEVALUATE();

({async async});