Skip to content

Commit

Permalink
Fix module name generation
Browse files Browse the repository at this point in the history
Atoms for which atom.toString() would yield
a quoted string (i.e. if it contains non-
ascii, numeric or _) would cause module names
to be emitted with the 's encoded into the name.
  • Loading branch information
krestenkrab committed Aug 15, 2013
1 parent 84ed016 commit 0dca178
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/erjang/EModuleManager.java
Expand Up @@ -117,7 +117,7 @@ private EFun getFunErrorHandler() {
}

private EFun makeErrorHandler() {
return EFun.get_fun_with_handler(fun.module.toString(), fun.function.toString(), fun.arity,
return EFun.get_fun_with_handler(fun.module.getName(), fun.function.getName(), fun.arity,
new EFunHandler() {

@Override
Expand Down Expand Up @@ -362,7 +362,7 @@ public EFun resolve(EPID pid, EBinary md5, int index, final int old_uniq, final

if (maker == null || !md5.equals(module_md5)) {
LocalFunID fid = new LocalFunID(module, ERT.am_undefined, arity, old_index, index, old_uniq, md5);
return EFun.get_fun_with_handler(this.module.toString(), "badfun", 0, new EFunHandler() {
return EFun.get_fun_with_handler(this.module.getName(), "badfun", 0, new EFunHandler() {
@Override
public EObject invoke(EProc proc, EObject[] args) throws Pausable {
throw new ErlangError(am_badfun, args);
Expand All @@ -386,7 +386,7 @@ public EFun resolve(final EPID pid, final int old_uniq, final int old_index, fin

if (maker==null) {
LocalFunID fid = new LocalFunID(module, ERT.am_undef, 0, old_index, 0, old_uniq, empty_md5);
return EFun.get_fun_with_handler(module.toString(), "badfun", 0, new EFunHandler() {
return EFun.get_fun_with_handler(module.getName(), "badfun", 0, new EFunHandler() {
@Override
public EObject invoke(EProc proc, EObject[] args) throws Pausable {
throw new ErlangError(am_badfun, args);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/erjang/ERT.java
Expand Up @@ -626,7 +626,7 @@ public static EFun resolve_fun(EObject mod, EObject fun, int arity) {

final EFun pfun = EModuleManager.resolve(new FunID(pmod, f, arity+1));

return EFun.get_fun_with_handler(pmod.toString(), f.toString(), arity, new EFunHandler() {
return EFun.get_fun_with_handler(pmod.getName(), f.getName(), arity, new EFunHandler() {
@Override
public EObject invoke(EProc proc, EObject[] args) throws Pausable {
EObject[] real_args = new EObject[args.length+1];
Expand Down

0 comments on commit 0dca178

Please sign in to comment.