Permalink
Browse files

Make sure module attributes are ordered correctly

We returning the result of

   Module:module_info(attributes)
   Module:module_info(compile)

In the reverse order.  Not a big deal, but Elixir
tests that the order of attributes is like they
appear in the source file.
  • Loading branch information...
1 parent 599c6a1 commit 8683c92eced49c3abd81ead24a7784ae2995eca5 @krestenkrab krestenkrab committed Oct 6, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/erjang/beam/CompilerVisitor.java
@@ -107,8 +107,8 @@
EAtom am_source = EAtom.intern("source");
- ECons atts = ERT.NIL;
- ECons compile_info = ERT.NIL;
+ ESeq atts = ERT.NIL;
+ ESeq compile_info = ERT.NIL;
String source = null;
private Set<String> exported = new HashSet<String>();
@@ -416,11 +416,11 @@ private void generate_classinit() {
cv.visitField(ACC_STATIC, "attributes", ESEQ_DESC,
null, null).visitEnd();
- constants.put(atts, "attributes");
+ constants.put(atts.reverse(), "attributes");
cv.visitField(ACC_STATIC, "compile", ESEQ_DESC,
null, null).visitEnd();
- constants.put(compile_info, "compile");
+ constants.put(compile_info.reverse(), "compile");
if (this.module_md5 != null) {

0 comments on commit 8683c92

Please sign in to comment.