about to change toplevel reference and setting again

This commit is contained in:
Danny Yoo 2012-02-27 17:53:35 -05:00
parent 5654cf7432
commit 8d9c1100f7
3 changed files with 20 additions and 4 deletions

View File

@ -53,10 +53,15 @@
(symbol->string
(kernel-module-variable->primitive-name n)))]
[else
(format "{moduleName:~s,name:~s}"
(symbol->string
(define module-name
(symbol->string
(ModuleLocator-name
(ModuleVariable-module-name n)))
(ModuleVariable-module-name n))))
(format "{moduleName:~s,name:~s,prefix:M.modules[~s].prefix,offset:M.modules[~s].getPrefixOffset(~s)}"
module-name
(symbol->string (ModuleVariable-name n))
module-name
module-name
(symbol->string (ModuleVariable-name n)))])]))
names)
",")

View File

@ -71,6 +71,17 @@
this.privateExports = {};
};
// Returns the offset into the prefix in which the value will be stored.
ModuleRecord.prototype.getPrefixOffset = function(externalName) {
var i;
for (i = 0; i < this.prefix.names; i++) {
if (this.prefix.names[i] === externalName) {
return i;
}
}
return void(0);
};
// Returns access to the names defined in the module.
ModuleRecord.prototype.getNamespace = function () {
return this.namespace;

View File

@ -7,4 +7,4 @@
(provide version)
(: version String)
(define version "1.185")
(define version "1.186")