ExportDeclaration : HoistableDeclaration; Fixes gh-2068 (#2737)

This commit is contained in:
Rick Waldron 2020-08-20 17:42:35 -04:00 committed by GitHub
parent d6fba2035b
commit ced63df97b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 165 additions and 0 deletions

View File

@ -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() {}

View File

@ -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 = '';

View File

@ -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() {}

View File

@ -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 = '';

View File

@ -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() {}

View File

@ -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 = '';

View File

@ -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() {}

View File

@ -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 = '';