Repository: flex-falcon Updated Branches: refs/heads/develop edea80cd8 -> 8d0d623d3
Fix ClassDirectiveProcessor for JS Object. Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/8d0d623d Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/8d0d623d Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/8d0d623d Branch: refs/heads/develop Commit: 8d0d623d3bc010ede4b7f3eae8ef5a75ca0c1471 Parents: edea80c Author: Michael Schmalle <[email protected]> Authored: Tue Jun 9 15:53:45 2015 -0400 Committer: Michael Schmalle <[email protected]> Committed: Tue Jun 9 15:54:08 2015 -0400 ---------------------------------------------------------------------- .../as/codegen/ClassDirectiveProcessor.java | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8d0d623d/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java ---------------------------------------------------------------------- diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java index 60cf7d6..21afb92 100644 --- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java +++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java @@ -277,19 +277,24 @@ class ClassDirectiveProcessor extends DirectiveProcessor // Check that the superclass isn't a forward reference, but only need to do this if both // definitions come from the same containing source. getContainingFilePath() returns the file // from the ASFileScope, so no need to worry about included files. - if (!classDefinition.isGeneratedEmbedClass() && classDefinition.getContainingFilePath().equals(superclassDefinition.getContainingFilePath())) + + // XXX (mschmalle) Added for JS Object impl, shouldn't have side effects + if (superclassDefinition != null) { - // If the absolute offset in the class is less than the - // offset of the super class, it must be a forward reference in the file - int classOffset = classDefinition.getAbsoluteStart(); - int superClassOffset = superclassDefinition.getAbsoluteEnd(); - if (classOffset < superClassOffset) - classScope.addProblem(new ForwardReferenceToBaseClassProblem(node, superclassDefinition.getQualifiedName())); - } + if (!classDefinition.isGeneratedEmbedClass() && classDefinition.getContainingFilePath().equals(superclassDefinition.getContainingFilePath())) + { + // If the absolute offset in the class is less than the + // offset of the super class, it must be a forward reference in the file + int classOffset = classDefinition.getAbsoluteStart(); + int superClassOffset = superclassDefinition.getAbsoluteEnd(); + if (classOffset < superClassOffset) + classScope.addProblem(new ForwardReferenceToBaseClassProblem(node, superclassDefinition.getQualifiedName())); + } - // Set the superclass Name. - this.superclassName = superclassDefinition.getMName(project); - iinfo.superName = superclassName; + // Set the superclass Name. + this.superclassName = superclassDefinition.getMName(project); + iinfo.superName = superclassName; + } // Resolve the interfaces. IInterfaceDefinition[] interfaces = classDefinition.resolveImplementedInterfaces(
