exporting a class

# Brandon Benvie (13 years ago)

Is it correct that there's no way to export a class declaration? The best I can see is something like module Geometry { export let Point = class Point { .. } }

# Alex Russell (13 years ago)

On Sep 26, 2012 11:10 AM, "Brandon Benvie" <brandon at brandonbenvie.com>

wrote:

Is it correct that there's no way to export a class declaration? The best

I can see is something like

module Geometry { export let Point = class Point { .. }

Just use: export class Point { .. }

# Brandon Benvie (13 years ago)

The reason I ask is because the only grammar reference I could find was at [1] which doesn't include class. I also noticed that while esprima parses both classes and modules, it doesn't allow module declaration exports.

[1] harmony:modules

# Alex Russell (13 years ago)

+dherman

It seems this hasn't been updated to account for the class binding form. What I wrote should work, though, and it'll be a bug in the spec if it doesn't.