Actions
Bug #3229
closedCom bool values not handled correctly
Start date:
01/26/2017
Due date:
% Done:
0%
Estimated time:
Operative System:
All
Regression:
No
Description
When passing a boolean value into a comcall as an argument the mSL input value is not (correctly) converted to a boolean value. When a com result returns a boolean value, the value should be converted to either $true or $false
;; Test on adiirc 32bit without tsc.dll uninstalled
alias booltest {
var %error
var %js = (function(){getTrue=function(){return true};getFalse=function(){return false};input=function(input){return input}})();
.comopen booltest MSScriptControl.ScriptControl
if (!$com(booltest)) {
%Error = Failed to create ScriptControl instance
}
elseif (!$com(booltest, language, 4, bstr, jscript) || $comerr) {
%Error = Failed to set language
}
elseif (!$com(booltest, ExecuteStatement, 1, bstr, %js) || $comerr) {
%Error = Failed to initialize js
}
elseif (!$com(booltest, eval, 1, bstr, this, dispatch* booltest/js) || $comerr || !$com(booltest/js)) {
%Error = Failed to retrieve pointer to js instance
}
else {
;; retriving bool values from result
noop $com(booltest/js, getTrue, 1)
echo -a This should be $true instead its: $com(booltest/js).result
noop $com(booltest, getFalse, 1)
echo -a This should be $false instead its: $com(booltest/js).result
;; passing in boolean values
noop $com(booltest/js, input, 1, bool, $true)
echo -a This should be $true instead its: $com(booltest/js).result
noop $com(booltest/js, input, 1, bool, $false)
echo -a This should be $false instead its: $com(booltest/js).result
}
:error
if ($com(booltest/js)) .comclose $v1
if ($com(booltest)) .comclose $v1
if ($error || %Error) {
echo -s Error: $v1
reseterror
}
}
Updated by S Reject almost 8 years ago
That should be WITH tsc.dll uninstalled. As in the dll should not be installed while testing.
Updated by Per Amundsen almost 8 years ago
- Status changed from New to Resolved
Thanks fixed for next beta.
Updated by Per Amundsen almost 8 years ago
- Status changed from Resolved to Closed
Actions