Skip to content

Commit f9d40ed

Browse files
committed
#62 makes namespace names consistent with others nodes by avoiding using identifier nodes
1 parent 145814b commit f9d40ed

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/ast/namespace.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ var KIND = 'namespace';
1717
*/
1818
var Namespace = Block.extends(function Namespace(name, children, withBrackets, location) {
1919
Block.apply(this, [KIND, children, location]);
20-
if (name instanceof Identifier) {
21-
this.name = name;
22-
} else {
23-
this.name = new Identifier(name);
24-
}
20+
this.name = name;
2521
this.withBrackets = withBrackets || false;
2622
});
2723

src/parser/namespace.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ module.exports = {
3131
this.currentNamespace = name;
3232
var body = this.nextWithComments().read_top_statements();
3333
this.expect(this.EOF);
34-
return result(name, body, false);
34+
return result(name.name, body, false);
3535
} else if (this.token == '{') {
3636
this.currentNamespace = name;
3737
var body = this.nextWithComments().read_top_statements();
3838
this.expect('}') && this.nextWithComments();
39-
return result(name, body, true);
39+
return result(name.name, body, true);
4040
} else if (this.token === '(') {
4141
// resolve ambuiguity between namespace & function call
4242
name.resolution = this.ast.identifier.RELATIVE_NAME;

0 commit comments

Comments
 (0)