Repository navigation
fix(runtime): preserve util.promisify.custom on Windows child process hide shims (#695) - #756
Closed
yaojin3616 wants to merge 1 commit into
Closed
yaojin3616 wants to merge 1 commit into
yaojin3616 wants to merge 1 commit into
Conversation
Contributor
Author
|
感谢补齐 Windows promisify 契约和回归测试。对当前 head 的定点执行发现:promisify(execFile)(file, undefined, {encoding:'buffer'}) 会丢弃第三个 options,stdout 实际为 string;二参 execFile(file, callback) 也仍丢失 callback。#711 在同样调用下均保留契约,且覆盖结果、错误与 Promise.child。我已在 #711 记录贡献与测试承接要求,本次将这个不完整的重复实现关闭,统一由 #711 接续。#711 目前仍开放、尚未合并,这不代表主线或正式版已修复;仍需 Windows 实际安装包验收。谢谢贡献! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题
修复 #695:Windows 下
build/windows-child-process-hide.mjs重写childProcess.execFile与exec时丢失挂载在其上的util.promisify.custom符号,导致第三方插件在执行promisify(execFile)时退化为裸 stdout 字符串,解构{ stdout, stderr }拿到undefined,进而抛出 TypeError 崩掉 Harness 子进程。变更说明
util.promisify.custom:为childProcess.exec与childProcess.execFile显式保留自定义 promisify 钩子,自动注入windowsHide: true并确保返回标准的{ stdout, stderr }结构及promise.child。patchedExecFile参数传递:兼容调用方传入execFile(file, options, callback)(3 参数形态,args 为 options 对象)时的参数规整化,避免将 options 错位传递给底层 Node。test/harness-node-entry.test.ts中新增对promisify(execFile)与promisify(exec)完整返回结构的集成回归断言。验证
npm test -- test/harness-node-entry.test.ts全部 29 个测试用例通过。npm run typecheck干净通过。git diff --check无格式异常。