mirror of
https://github.com/gnh1201/welsonjs.git
synced 2026-02-01 14:11:58 +00:00
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:
parent
0c79192a63
commit
3fbcd71bc5
7
app.js
7
app.js
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user