Skip to content

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

@meixg

Description

@meixg

如下代码:

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""
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions