Fix type checks and update version in pipe-ipc.js

Corrects type checking for callback and position parameters in app.js and pipe-ipc.js, ensuring proper function behavior. Also updates the version string in pipe-ipc.js to 0.1.26.
This commit is contained in:
Namhyeon Go 2026-01-21 17:44:17 +09:00
parent 0c79192a63
commit 3fbcd71bc5
2 changed files with 7 additions and 4 deletions

7
app.js
View File

@ -189,6 +189,10 @@ if (typeof CreateObject === "undefined") {
if (typeof UseObject === "undefined") {
var UseObject = function(progId, callback, dispose) {
if (typeof callback !== "function") {
return null;
}
if (typeof dispose !== "function") {
dispose = function(obj) {
try {
@ -199,8 +203,7 @@ if (typeof UseObject === "undefined") {
var obj = CreateObject(progId);
try {
return (typeof callback === "function" ?
callback(obj) : null);
return callback(obj);
} finally {
dispose(obj);
obj = null;

View File

@ -160,7 +160,7 @@ function Converter() {
};
this.repositionObject = function(stream, position) {
position = (position !== "number" ? 0 : position);
position = (typeof position !== "number" ? 0 : position);
var _dispose = function() {}; // prevent dispose after repositionObject
@ -571,7 +571,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist;
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
exports.adModeReadWrite = adModeReadWrite;
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.25";
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.26";
exports.AUTHOR = "gnh1201@catswords.re.kr";
exports.global = global;
exports.require = require;