// Copyright (C) 2017 Leo Balter. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- path: language/expressions/async-function/nameless- name: async function nameless expression esid: sec-async-function-definitions info: | 14.6 Async Function Definitions AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } flags: [async] ---*/ var callCount = 0; var f = async function(/*{ params }*/) { /*{ body }*/ callCount = callCount + 1; } f(/*{ args }*/) .then(_ => { throw new Test262Error('function should not be resolved'); }, error => assert.sameValue(error.constructor, /*{ error }*/)) .then(() => { assert.sameValue(callCount, 0, 'function body is not evaluated'); }, $DONE) .then($DONE, $DONE);