mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 18:20:22 +02:00
Make child structs applicable.
* module/language/js-il/runtime.js (scheme.Struct): When certain flags are set, child structs should be marked as applicable.
This commit is contained in:
parent
46fa3b2fb8
commit
70c25b1290
1 changed files with 16 additions and 0 deletions
|
@ -439,6 +439,22 @@ scheme.Struct = function (vtable, nfields) {
|
|||
this.vtable = vtable;
|
||||
this.fields = [];
|
||||
|
||||
if (this.vtable && this.vtable.hasOwnProperty('children_applicable_vtables')) {
|
||||
this.is_vtable = true;
|
||||
this.children_applicable = true;
|
||||
}
|
||||
|
||||
if (this.vtable && this.vtable.hasOwnProperty('children_applicable')) {
|
||||
this.is_applicable = true;
|
||||
this.fun = function (self, cont) {
|
||||
var scm_applicable_struct_index_procedure = 0;
|
||||
var clos = self.fields[scm_applicable_struct_index_procedure];
|
||||
return clos.fun(clos, cont);
|
||||
};
|
||||
} else {
|
||||
this.fun = function () { throw "not applicable"; };
|
||||
}
|
||||
|
||||
// FIXME: worth doing?
|
||||
for(var i = 0; i < nfields; i++){
|
||||
this.fields[i]=scheme.UNDEFINED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue