shorthand property assigment initializer 如果是import 进来的函数,无法正确添加 namespace。
Open
Nobody has claimed this yet.
help wanted
- Dominant language
- TypeScript
- Stars
- 98
- Forks
- 20
- Avg merge
- 5m
- Merged PRs (30d)
- 3
Description
如下代码:
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""
);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the handling of ShorthandPropertyAssignment.name and how imported symbols are resolved. Compare shorthand and explicit property assignment translation, and consider the issue complete when the shorthand form produces the imported namespace-qualified value, such as "\someModule\aaa", in the generated PHP.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100