Skip to content

Commit

Permalink
ExportDeclaration : HoistableDeclaration; Fixes gh-2068
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Aug 20, 2020
1 parent e0a65ee commit 8131d2d
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 0 deletions.
@@ -0,0 +1,23 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : AsyncFunctionDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
AsyncFunctionDeclaration[?Yield, ?Await, ?Default]
flags: [module]
negative:
phase: parse
type: SyntaxError
---*/

$DONOTEVALUATE();

class A {};
export default async function A() {}
@@ -0,0 +1,18 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : AsyncFunctionDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
AsyncFunctionDeclaration[?Yield, ?Await, ?Default]
flags: [module]
---*/

export default async function A() {}
A.foo = '';
@@ -0,0 +1,23 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : AsyncGeneratorDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
AsyncGeneratorDeclaration[?Yield, ?Await, ?Default]
flags: [module]
negative:
phase: parse
type: SyntaxError
---*/

$DONOTEVALUATE();

class AG {}
export default async function * AG() {}
@@ -0,0 +1,18 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : AsyncGeneratorDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
AsyncGeneratorDeclaration[?Yield, ?Await, ?Default]
flags: [module]
---*/

export default async function * AG() {}
AG.foo = '';
@@ -0,0 +1,24 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : FunctionDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
FunctionDeclaration[?Yield, ?Await, ?Default]
flags: [module]
negative:
phase: parse
type: SyntaxError
---*/

$DONOTEVALUATE();

class F {}
export default function F() {}

@@ -0,0 +1,18 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : FunctionDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
FunctionDeclaration[?Yield, ?Await, ?Default]
flags: [module]
---*/

export default function F() {}
F.foo = '';
@@ -0,0 +1,23 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : GeneratorDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
GeneratorDeclaration[?Yield, ?Await, ?Default]
flags: [module]
negative:
phase: parse
type: SyntaxError
---*/

$DONOTEVALUATE();

class G {}
export default function * G() {}
@@ -0,0 +1,18 @@
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
ExportDeclaration : HoistableDeclaration : GeneratorDeclaration
esid: prod-HoistableDeclaration
info: |
ExportDeclaration :
HoistableDeclaration[Yield, Await, Default]:
HoistableDeclaration[Yield, Await, Default]:
GeneratorDeclaration[?Yield, ?Await, ?Default]
flags: [module]
---*/

export default function * G() {}
G.foo = '';

0 comments on commit 8131d2d

Please sign in to comment.