(function() {
+Number.prototype.__defineGetter__('$cyt', function() {
+ if (this.$cyt_)
+ return this.$cyt_;
+ if ((this|0) == this)
+ return int;
+});
+
this.typeid = function(object) {
return object.$cyt;
};
let $cy_set = function(object, properties) {
for (const name in properties)
+ if ("defineProperty" in Object)
Object.defineProperty(object, name, {
configurable: true,
enumerable: false,
writable: true,
value: properties[name],
- });
+ }); else object[name] = properties[name];
};
$cy_set(Boolean.prototype, {
$cy_set(Number.prototype, {
toCYON: function() {
if ("$cyt" in this)
- return `${this.$cyt.toCYON()}(${this.toString()})`;
+ //return `${this.$cyt.toCYON()}(${this.toString()})`;
+ return this.toString();
return `new Number(${this.toString()})`;
},
});
this.put(key, value);
},
});
+
+ $cy_set(java.lang.Throwable.prototype, {
+ toCYON: function() {
+ var message = this.getMessage();
+ if (message == null)
+ message = '';
+ else
+ message = message.toCYON();
+
+ let stack = this.getStackTrace();
+ if (stack.length == 0)
+ stack = '';
+ else {
+ stack = stack.join('\n ');
+ stack = ` /*\n ${stack} */`;
+ }
+
+ return `new ${this.constructor.class.getName()}(${message})${stack}`;
+ },
+ });
});
}
if (path != null)
return path;
} else {
- let cwd = new (typedef char[1024]);
+ let cwd = *new (typedef char[1024]);
cwd = getcwd(cwd, cwd.length).toString();
cwd = cwd.split('/');