Skip to content
Snippets Groups Projects
Commit 19eb1d2e authored by Joseph Pecoraro's avatar Joseph Pecoraro Committed by Leo Balter
Browse files

Add tests for completion value of function / class declaration statements (#1012)

parent c1e25721
No related branches found
No related tags found
No related merge requests found
// Copyright (C) 2017 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-async-function-definitions-runtime-semantics-evaluation
description: Async function declaration completion value is empty.
info: >
AsyncFunctionDeclaration : async [no LineTerminator here] function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
1. Return NormalCompletion(empty).
---*/
assert.sameValue(eval('async function f() {}'), undefined);
assert.sameValue(eval('1; async function f() {}'), 1);
// Copyright (C) 2017 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-class-definitions-runtime-semantics-evaluation
description: Class declaration completion value is empty.
info: >
ClassDeclaration : class BindingIdentifier ClassTail
1. Perform ? BindingClassDeclarationEvaluation of this ClassDeclaration.
2. Return NormalCompletion(empty).
---*/
assert.sameValue(eval('class C {}'), undefined);
assert.sameValue(eval('1; class C {}'), 1);
// Copyright (C) 2017 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-function-definitions-runtime-semantics-evaluation
description: Function declaration completion value is empty.
info: >
FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
1. Return NormalCompletion(empty).
---*/
assert.sameValue(eval('function f() {}'), undefined);
assert.sameValue(eval('1; function f() {}'), 1);
// Copyright (C) 2017 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-statement-semantics-runtime-semantics-evaluation
description: Generator declaration completion value is empty.
info: >
GeneratorDeclaration[Yield, Await, Default]:
function * BindingIdentifier[?Yield, ?Await] ( FormalParameters[+Yield, ~Await] ) { GeneratorBody }
HoistableDeclaration : GeneratorDeclaration
1. Return NormalCompletion(empty).
---*/
assert.sameValue(eval('function* f() {}'), undefined);
assert.sameValue(eval('1; function* f() {}'), 1);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment