Skip to content

Commit

Permalink
plugin_nodeで関数定義の間違いを修正 #1420
Browse files Browse the repository at this point in the history
  • Loading branch information
kujirahand committed Jun 25, 2023
1 parent 703a030 commit 9f8737b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion installer/nako3-win32-template/bin/tools/command.txt
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@
+ plugin_node(��{�v���O�C��,cnako,phpnako)
- �t�@�C�����o��
|�J,"F��|F����","�t�@�C��F���J��",0,,����,�Ђ炭
|��,"S��|S����","�t�@�C��S���J��",0,,����,���
|��,"F��|F����","�t�@�CFS���J��",0,,����,���
|�o�C�i����,"S��|S����","�t�@�C��S���o�C�i��(Buffer)�Ƃ��ĊJ��",0,,����,�΂��Ȃ���
|�ۑ�,"S��F��|F��","�f�[�^S���t�@�C��F�w��������(�����R�[�h��UTF-8)",0,,����,�ق���
|SJIS�t�@�C����,"S��|S����","SJIS�`���̃t�@�C��S��ǂݍ���",0,,����,SJIS�ӂ�������
Expand Down
6 changes: 3 additions & 3 deletions src/plugin_node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ export default {
josi: [['を', 'から']],
pure: true,
asyncFn: true,
fn: function (s, _sys) {
fn: function (f, sys) {
return new Promise((resolve, reject) => {
// ファイルを読む
fs.readFile(s, 'utf-8', (err, text) => {
fs.readFile(f, 'utf-8', (err, text) => {
if (err) {
reject(new Error(`ファイル『${s}』が開けませんでした。理由:${err.message}`));
reject(new Error(`ファイル『${f}』が開けませんでした。理由:${err.message}`));
return;
}
resolve(text);
Expand Down
8 changes: 4 additions & 4 deletions src/plugin_node.mts
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ export default {
})
}
},
'読': { // @ファイルSを開く // @よむ
'読': { // @ファイFSを開く // @よむ
type: 'func',
josi: [['を', 'から']],
pure: true,
asyncFn: true,
fn: function (s: string, _sys: any) {
fn: function (f: string, sys: any) {
return new Promise((resolve, reject) => {
// ファイルを読む
fs.readFile(s, 'utf-8', (err: any, text: any) => {
fs.readFile(f, 'utf-8', (err: any, text: any) => {
if (err) {
reject(new Error(`ファイル『${s}』が開けませんでした。理由:${err.message}`))
reject(new Error(`ファイル『${f}』が開けませんでした。理由:${err.message}`))
return
}
resolve(text)
Expand Down

0 comments on commit 9f8737b

Please sign in to comment.