Fix invalid codegen for number member expr

This commit is contained in:
Amjad Masad
2015-12-15 17:46:42 -08:00
parent 59f5e7f218
commit 320cede9be
2 changed files with 7 additions and 8 deletions

View File

@@ -16,6 +16,11 @@ suite("generation", function () {
assert.ok(t.VISITOR_KEYS[type], type + " should not exist");
});
});
test("valid code", function() {
// Should not generate `0.foo`
new Function(generate.default(t.memberExpression(t.numericLiteral(60702), t.identifier("foo"))).code);
});
});
var suites = require("babel-helper-fixtures").default(__dirname + "/fixtures");