Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server blame label not correct when range contract is violated #62

Open
mlippens opened this issue Nov 12, 2013 · 0 comments
Open

Server blame label not correct when range contract is violated #62

mlippens opened this issue Nov 12, 2013 · 0 comments

Comments

@mlippens
Copy link

Titles are hard so let me elaborate:
When using the manual modules using exports and use, the blame labels are not correct when the server should be blamed (i.e. the module serving it's code). According to my own findings, the problem is with this check on line 514 in contracts.js: server = (toblame.isServer ? toblame : other);. When toblame is not a ModuleName, this will always result into other being the result in server.

The following gist is just created from the example you've given in the wiki page, with which I've experimented to confirm this bug.
https://gist.github.com/froginvasion/7437702

A possible fix would be to set a ModuleName in use of a module instead of a plain string. I suppose that would be a good fix since use is theoretically called each time a module is 'imported'.

snippet:

//hoisted to top:
var mod;
//... rest of code
if(typeof orig.server === "string"){
  mod = new ModuleName(orig.server,"",true);
} else {
  mod = orig.server;
}
res[name] = orig.originalContract.check(orig.originalValue, mod, moduleName, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant