Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shorthand property assigment initializer 如果是import 进来的函数,无法正确添加 namespace。 #78

Open
meixg opened this issue Nov 6, 2019 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@meixg
Copy link
Member

meixg commented Nov 6, 2019

如下代码:

import {aaa} from './aaa'; // namespace: \someModule\
let a = {
    aaa: aaa
};

现在可以正确翻译成:

require_once(dirname(__FILE__) . '/' . "./aaa.php");
$a = array(
    "aaa" => "\someModule\aaa"
);

但是如果使用简写形式:

import {aaa} from './aaa'; // namespace: \someModule\
let a = {
    aaa
};

从 ShorthandPropertyAssignment.name 中不能查找到 import 部分,无法添加上 namespace。

require_once(dirname(__FILE__) . '/' . "./aaa.php");
$a = array(
    "aaa" => ""aaa""
);
@meixg meixg added the help wanted Extra attention is needed label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant