summaryrefslogtreecommitdiff
path: root/details.js
diff options
context:
space:
mode:
Diffstat (limited to 'details.js')
-rw-r--r--details.js47
1 files changed, 26 insertions, 21 deletions
diff --git a/details.js b/details.js
index 57a5f44..452d336 100644
--- a/details.js
+++ b/details.js
@@ -305,37 +305,43 @@ function ScilabInteger() {
}
function int32() {
- var int = new ScilabInteger(arguments[0]);
+ var args = Array.prototype.slice.call(arguments);
+ var int = new ScilabInteger(...args);
int.intPrecision = "sci_int32";
return int;
}
function int16() {
- var int = new ScilabInteger(arguments[0]);
+ var args = Array.prototype.slice.call(arguments);
+ var int = new ScilabInteger(...args);
int.intPrecision = "sci_int16";
return int;
}
function int8() {
- var int = new ScilabInteger(arguments[0]);
+ var args = Array.prototype.slice.call(arguments);
+ var int = new ScilabInteger(...args);
int.intPrecision = "sci_int8";
return int;
}
function uint32() {
- var int = new ScilabInteger(arguments[0]);
+ var args = Array.prototype.slice.call(arguments);
+ var int = new ScilabInteger(...args);
int.intPrecision = "sci_uint32";
return int;
}
function uint16() {
- var int = new ScilabInteger(arguments[0]);
+ var args = Array.prototype.slice.call(arguments);
+ var int = new ScilabInteger(...args);
int.intPrecision = "sci_uint16";
return int;
}
function uint8() {
- var int = new ScilabInteger(arguments[0]);
+ var args = Array.prototype.slice.call(arguments);
+ var int = new ScilabInteger(...args);
int.intPrecision = "sci_uint8";
return int;
}
@@ -549,31 +555,30 @@ function BasicBlock() {
}
function sci2exp(c) {
- if(c.scilabClass == "ScilabList") {
+ if (c.scilabClass == "ScilabList") {
c = Object.create(c);
c.scilabClass = "";
- if(c.length) {
+ if (c.length) {
return "list(" + sci2exp(c) + ")";
- }
- else {
+ } else {
return "list()";
}
- }
- else if(typeof c.length === "undefined") {
- return c.toString();
- }
- else if (c.length == 0) {
+ } else if (typeof c.length === "undefined") {
+ return _check(c);
+ } else if (c.length == 0) {
return "[]";
- }
- else if (c.length == 1)
- return c.toString();
- else {
+ } else if (c.length == 1) {
+ return _check(c[0]);
+ } else {
var result = "[";
for (var i = 0; i < c.length; i++) {
if (typeof c[i].length === 'undefined') {
- result += c[i] + ",";
+ result += _check(c[i]) + ",";
} else {
- result += c[i][0] + ";";
+ for (var j = 0; j < c[i].length - 1; j++) {
+ result += _check(c[i][j]) + ",";
+ }
+ result += _check(c[i][c[i].length - 1]) + ";";
}
}
result = result.substring(0, result.length - 1);