diff options
author | Leonardo Balter <leonardo.balter@gmail.com> | 2017-03-14 16:24:26 -0400 |
---|---|---|
committer | Leonardo Balter <leonardo.balter@gmail.com> | 2017-03-14 16:27:56 -0400 |
commit | 41370bcb994d564b9b3ea35734ed1a6939e1bc9a (patch) | |
tree | 099313c36baa808030cc2fbe2fd6c15048d373ba /src/arguments/default/gen-func-decl.template | |
parent | aa2c69960df33b96634d4b4f44a7c2b0f2038815 (diff) | |
download | qtdeclarative-testsuites-41370bcb994d564b9b3ea35734ed1a6939e1bc9a.tar.gz |
Create tests for trailing comma on arguments list
Diffstat (limited to 'src/arguments/default/gen-func-decl.template')
-rw-r--r-- | src/arguments/default/gen-func-decl.template | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/arguments/default/gen-func-decl.template b/src/arguments/default/gen-func-decl.template new file mode 100644 index 000000000..b9e7fdcc9 --- /dev/null +++ b/src/arguments/default/gen-func-decl.template @@ -0,0 +1,25 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/arguments-object/gen-func-decl- +name: generator function declaration +esid: sec-arguments-exotic-objects +info: | + 9.4.4 Arguments Exotic Objects + + Most ECMAScript functions make an arguments object available to their code. Depending upon the + characteristics of the function definition, its arguments object is either an ordinary object + or an arguments exotic object. +---*/ + +var callCount = 0; +// Stores a reference `ref` for case evaluation +function* ref(/*{ params }*/) { + /*{ body }*/ + callCount = callCount + 1; +} + +ref(/*{ args }*/).next(); + +assert.sameValue(callCount, 1, 'generator function invoked exactly once'); |