Merge with trunk javascript-with
authorPetr Pisl <ppisl@netbeans.org>
Tue, 13 Aug 2013 14:38:34 +0200
branchjavascript-with
changeset 269447c47ea13d7c27
parent 269445 51ba53e2ae6c
parent 269446 36a49342e345
child 269448 5cbdcccf7a98
Merge with trunk
csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java
html.knockout/test/unit/data/completion/issue231569/index.html.testIssue234569.completion
javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsCodeCompletionWith.java
     1.1 --- a/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java	Tue Aug 13 14:01:33 2013 +0200
     1.2 +++ b/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java	Tue Aug 13 14:38:34 2013 +0200
     1.3 @@ -1396,7 +1396,7 @@
     1.4          });
     1.5      }
     1.6  
     1.7 -    private String annotateFinderResult(Snapshot snapshot, Map<OffsetRange, ColoringAttributes> highlights, int caretOffset) throws Exception {
     1.8 +    protected String annotateFinderResult(Snapshot snapshot, Map<OffsetRange, ColoringAttributes> highlights, int caretOffset) throws Exception {
     1.9          Set<OffsetRange> ranges = highlights.keySet();
    1.10          StringBuilder sb = new StringBuilder();
    1.11          CharSequence text = snapshot.getText();
    1.12 @@ -1505,7 +1505,7 @@
    1.13          });
    1.14      }
    1.15      
    1.16 -    private void checkNoOverlaps(Set<OffsetRange> ranges, Document doc) throws BadLocationException {
    1.17 +    protected void checkNoOverlaps(Set<OffsetRange> ranges, Document doc) throws BadLocationException {
    1.18          // Make sure there are no overlapping ranges
    1.19          List<OffsetRange> sortedRanges = new ArrayList<OffsetRange>(ranges);
    1.20          Collections.sort(sortedRanges);
    1.21 @@ -1520,7 +1520,7 @@
    1.22          }
    1.23      }
    1.24  
    1.25 -    private String annotateSemanticResults(Document doc, Map<OffsetRange, Set<ColoringAttributes>> highlights) throws Exception {
    1.26 +    protected String annotateSemanticResults(Document doc, Map<OffsetRange, Set<ColoringAttributes>> highlights) throws Exception {
    1.27          StringBuilder sb = new StringBuilder();
    1.28          String text = doc.getText(0, doc.getLength());
    1.29          Map<Integer, OffsetRange> starts = new HashMap<Integer, OffsetRange>(100);
     2.1 --- a/html.knockout/src/org/netbeans/modules/html/knockout/KOJsEmbeddingProviderPlugin.java	Tue Aug 13 14:01:33 2013 +0200
     2.2 +++ b/html.knockout/src/org/netbeans/modules/html/knockout/KOJsEmbeddingProviderPlugin.java	Tue Aug 13 14:38:34 2013 +0200
     2.3 @@ -76,7 +76,7 @@
     2.4      private final LinkedList<StackItem> stack;
     2.5      private String lastTagOpen = null;
     2.6  
     2.7 -    private final List<String> parents = new ArrayList<>();
     2.8 +    private final List<ParentContext> parents = new ArrayList<>();
     2.9  
    2.10      private String data;
    2.11  
    2.12 @@ -200,6 +200,7 @@
    2.13      }
    2.14  
    2.15      private void startKnockoutSnippet(String newData, boolean foreach) {
    2.16 +        assert !foreach || newData != null;
    2.17          if (newData != null) {
    2.18              String replacement = (data == null || data.equals("$root")) ? "ko.$bindings" : data;
    2.19              String toAdd = newData.replaceAll("$data", replacement);
    2.20 @@ -207,48 +208,46 @@
    2.21              if (foreach) {
    2.22                  toAdd = toAdd + "[0]";
    2.23              }
    2.24 -            parents.add((data == null || "$root".equals(data)) ? "ko.$bindings" : data);
    2.25 +            if (data == null || "$root".equals(data)) {
    2.26 +                parents.add(new ParentContext("ko.$bindings", false));
    2.27 +            } else {
    2.28 +                parents.add(new ParentContext(data, foreach));
    2.29 +            }
    2.30              data = toAdd;
    2.31              inForEach = foreach;
    2.32          } else {
    2.33              StringBuilder sb = new StringBuilder();
    2.34              sb.append("(function(){\n"); // NOI18N
    2.35  
    2.36 +            // for now this is actually just a placeholder
    2.37 +            sb.append("var $element;\n");
    2.38 +
    2.39              // define root as reference
    2.40              sb.append("var $root = ko.$bindings;\n"); // NOI18N
    2.41  
    2.42 +            if (inForEach) {
    2.43 +                sb.append("var $index = 0;\n");
    2.44 +            }
    2.45 +
    2.46              // define data object
    2.47              if (data == null) {
    2.48                  data = "$root"; // NOI18N
    2.49              }
    2.50  
    2.51 -            // define parent and parents array
    2.52 -            if (parents.isEmpty()) {
    2.53 -                sb.append("var $parent = undefined;\n"); // NOI18N
    2.54 -            } else {
    2.55 -                sb.append("var $parent = ").append(parents.get(parents.size() - 1)).append(";\n"); // NOI18N
    2.56 -            }
    2.57 +            sb.append("var $parentContext = ");
    2.58 +            generateContext(sb, parents);
    2.59 +            sb.append(";\n");
    2.60  
    2.61 -            sb.append("var $parents = ["); // NOI18N
    2.62 -            for (String parent : parents) {
    2.63 -                sb.append(parent);
    2.64 -                sb.append(",");
    2.65 -            }
    2.66 -            if (!parents.isEmpty()) {
    2.67 -                sb.setLength(sb.length() - 1);
    2.68 -            }
    2.69 -            sb.append("];\n"); // NOI18N
    2.70 +            sb.append("var $context = ");
    2.71 +            List<ParentContext> current = new ArrayList<>(parents);
    2.72 +            current.add(new ParentContext(data, inForEach));
    2.73 +            generateContext(sb, current);
    2.74 +            sb.append(";\n");
    2.75 +            generateParentAndContextData("$context.", sb, parents);
    2.76  
    2.77 -            if (inForEach) {
    2.78 -                sb.append("var $index = 0;\n");
    2.79 -            }
    2.80 +            generateParents(sb, parents);
    2.81  
    2.82 -            // for now this is actually just a placeholder
    2.83 -            sb.append("var $element;\n");
    2.84 -
    2.85 -            for (int i = 0; i < parents.size(); i++) {
    2.86 -                sb.append("with (").append(parents.get(i)).append(") {\n");
    2.87 -            }
    2.88 +            generateWithHierarchyStart(sb, parents);
    2.89  
    2.90              String dataValue = data;
    2.91              if (data == null || "$root".equals(data)) {
    2.92 @@ -260,7 +259,9 @@
    2.93                  dataValue = "undefined";
    2.94              }
    2.95              sb.append("var $data = ").append(dataValue).append(";\n");
    2.96 -            sb.append("with (").append(dataValue).append(") {\n");
    2.97 +            generateWithHierarchyEnd(sb, parents);
    2.98 +
    2.99 +            sb.append("with ($data) {\n");
   2.100  
   2.101              embeddings.add(snapshot.create(sb.toString(), KOUtils.JAVASCRIPT_MIMETYPE));
   2.102          }
   2.103 @@ -272,18 +273,91 @@
   2.104              if (parents.isEmpty()) {
   2.105                  throw new IllegalStateException();
   2.106              }
   2.107 -            data = parents.remove(parents.size() - 1);
   2.108 +            ParentContext context = parents.remove(parents.size() - 1);
   2.109 +            data = context.getValue();
   2.110          } else {
   2.111              StringBuilder sb = new StringBuilder();
   2.112              sb.append("}\n");
   2.113 -            for (int i = 0; i < parents.size(); i++) {
   2.114 -                sb.append("}\n");
   2.115 -            }
   2.116              sb.append("});\n");
   2.117              embeddings.add(snapshot.create(sb.toString(), KOUtils.JAVASCRIPT_MIMETYPE));
   2.118          }
   2.119      }
   2.120  
   2.121 +    private static void generateContext(StringBuilder sb, List<ParentContext> parents) {
   2.122 +        if (parents.isEmpty()) {
   2.123 +            sb.append("undefined");
   2.124 +        } else {
   2.125 +            sb.append("{\n");
   2.126 +            sb.append("$parentContext :");
   2.127 +            generateContext(sb, parents.subList(0, parents.size() - 1));
   2.128 +            ParentContext parent = parents.get(parents.size() - 1);
   2.129 +            sb.append(",\n");
   2.130 +            sb.append("$root : ko.$bindings,\n");
   2.131 +                        if (parent.hasIndex()) {
   2.132 +                sb.append("$index : 0,\n");
   2.133 +            }
   2.134 +            sb.append("}");
   2.135 +        }
   2.136 +    }
   2.137 +
   2.138 +    private static void generateParentAndContextData(String additionalPrefix,
   2.139 +            StringBuilder sb, List<ParentContext> parents) {
   2.140 +
   2.141 +        if (parents.isEmpty()) {
   2.142 +            if (additionalPrefix != null) {
   2.143 +                sb.append(additionalPrefix).append("$parentContext.$data = undefined;\n");
   2.144 +            }
   2.145 +            sb.append("$parentContext.$data = undefined;\n");
   2.146 +            sb.append("var $parent = undefined;\n");
   2.147 +            return;
   2.148 +        }
   2.149 +        String prefix = "$parentContext.";
   2.150 +        for (int i = 0; i < parents.size() - 1; i++) {
   2.151 +            sb.append("with (").append(parents.get(i).getValue()).append(") {\n");
   2.152 +        }
   2.153 +        sb.append("var $parent = ").append(parents.get(parents.size() - 1).getValue()).append(";\n");
   2.154 +        for (int i = parents.size() - 2; i >= 0; i--) {
   2.155 +            if (additionalPrefix != null) {
   2.156 +                sb.append(additionalPrefix).append(prefix).append("$data = ").append(parents.get(i + 1).getValue()).append(";\n");
   2.157 +            }
   2.158 +            sb.append(prefix).append("$data = ").append(parents.get(i + 1).getValue()).append(";\n");
   2.159 +            prefix = prefix + "$parentContext.";
   2.160 +            sb.append("}\n");
   2.161 +        }
   2.162 +        if (additionalPrefix != null) {
   2.163 +            sb.append(additionalPrefix).append(prefix).append("$data = ko.$bindings;\n");
   2.164 +        }
   2.165 +        sb.append(prefix).append("$data = ko.$bindings;\n");
   2.166 +    }
   2.167 +
   2.168 +    private static void generateParents(StringBuilder sb, List<ParentContext> parents) {
   2.169 +        sb.append("var $parents = ["); // NOI18N
   2.170 +        int pos = sb.length();
   2.171 +        String prefix = "$parentContext.";
   2.172 +        for (int i = 0; i < parents.size(); i++) {
   2.173 +            sb.insert(pos, ",");
   2.174 +            sb.insert(pos, "$data");
   2.175 +            sb.insert(pos, prefix);
   2.176 +            prefix = prefix + "$parentContext.";
   2.177 +        }
   2.178 +        if (!parents.isEmpty()) {
   2.179 +            sb.setLength(sb.length() - 1);
   2.180 +        }
   2.181 +        sb.append("];\n"); // NOI18N
   2.182 +    }
   2.183 +
   2.184 +    private static void generateWithHierarchyStart(StringBuilder sb, List<ParentContext> parents) {
   2.185 +        for (ParentContext context : parents) {
   2.186 +            sb.append("with (").append(context.getValue()).append(") {\n");
   2.187 +        }
   2.188 +    }
   2.189 +
   2.190 +    private static void generateWithHierarchyEnd(StringBuilder sb, List<ParentContext> parents) {
   2.191 +        for (int i = 0; i < parents.size(); i++) {
   2.192 +            sb.append("}\n");
   2.193 +        }
   2.194 +    }
   2.195 +
   2.196      private static class StackItem {
   2.197  
   2.198          final String tag;
   2.199 @@ -294,4 +368,24 @@
   2.200              this.balance = 1;
   2.201          }
   2.202      }
   2.203 +
   2.204 +    private static class ParentContext {
   2.205 +
   2.206 +        private final String value;
   2.207 +
   2.208 +        private final boolean index;
   2.209 +
   2.210 +        public ParentContext(String value, boolean index) {
   2.211 +            this.value = value;
   2.212 +            this.index = index;
   2.213 +        }
   2.214 +
   2.215 +        public String getValue() {
   2.216 +            return value;
   2.217 +        }
   2.218 +
   2.219 +        public boolean hasIndex() {
   2.220 +            return index;
   2.221 +        }
   2.222 +    }
   2.223  }
     3.1 --- a/html.knockout/test/unit/data/KOTestProject/public_html/complex.html.virtual	Tue Aug 13 14:01:33 2013 +0200
     3.2 +++ b/html.knockout/test/unit/data/KOTestProject/public_html/complex.html.virtual	Tue Aug 13 14:38:34 2013 +0200
     3.3 @@ -16,56 +16,111 @@
     3.4  init();;
     3.5  });
     3.6  (function(){
     3.7 +var $element;
     3.8  var $root = ko.$bindings;
     3.9 +var $parentContext = undefined;
    3.10 +var $context = {
    3.11 +$parentContext :undefined,
    3.12 +$root : ko.$bindings,
    3.13 +};
    3.14 +$context.$parentContext.$data = undefined;
    3.15 +$parentContext.$data = undefined;
    3.16  var $parent = undefined;
    3.17  var $parents = [];
    3.18 -var $element;
    3.19  var $data = ko.$bindings;
    3.20 -with (ko.$bindings) {
    3.21 +with ($data) {
    3.22  (lidickove);}
    3.23  });
    3.24  (function(){
    3.25 +var $element;
    3.26  var $root = ko.$bindings;
    3.27 +var $index = 0;
    3.28 +var $parentContext = {
    3.29 +$parentContext :undefined,
    3.30 +$root : ko.$bindings,
    3.31 +};
    3.32 +var $context = {
    3.33 +$parentContext :{
    3.34 +$parentContext :undefined,
    3.35 +$root : ko.$bindings,
    3.36 +},
    3.37 +$root : ko.$bindings,
    3.38 +$index : 0,
    3.39 +};
    3.40  var $parent = ko.$bindings;
    3.41 -var $parents = [ko.$bindings];
    3.42 -var $index = 0;
    3.43 -var $element;
    3.44 +$context.$parentContext.$data = ko.$bindings;
    3.45 +$parentContext.$data = ko.$bindings;
    3.46 +var $parents = [$parentContext.$data];
    3.47  with (ko.$bindings) {
    3.48  var $data = lidickove[0];
    3.49 -with (lidickove[0]) {
    3.50 +}
    3.51 +with ($data) {
    3.52  (jmeno);}
    3.53 -}
    3.54  });
    3.55  (function(){
    3.56 +var $element;
    3.57  var $root = ko.$bindings;
    3.58 +var $index = 0;
    3.59 +var $parentContext = {
    3.60 +$parentContext :undefined,
    3.61 +$root : ko.$bindings,
    3.62 +};
    3.63 +var $context = {
    3.64 +$parentContext :{
    3.65 +$parentContext :undefined,
    3.66 +$root : ko.$bindings,
    3.67 +},
    3.68 +$root : ko.$bindings,
    3.69 +$index : 0,
    3.70 +};
    3.71  var $parent = ko.$bindings;
    3.72 -var $parents = [ko.$bindings];
    3.73 -var $index = 0;
    3.74 -var $element;
    3.75 +$context.$parentContext.$data = ko.$bindings;
    3.76 +$parentContext.$data = ko.$bindings;
    3.77 +var $parents = [$parentContext.$data];
    3.78  with (ko.$bindings) {
    3.79  var $data = lidickove[0];
    3.80 -with (lidickove[0]) {
    3.81 +}
    3.82 +with ($data) {
    3.83  (jmeno == 'pepa' ? 'jouda' :
    3.84  'king');}
    3.85 -}
    3.86  });
    3.87  (function(){
    3.88 +var $element;
    3.89  var $root = ko.$bindings;
    3.90 +var $parentContext = undefined;
    3.91 +var $context = {
    3.92 +$parentContext :undefined,
    3.93 +$root : ko.$bindings,
    3.94 +};
    3.95 +$context.$parentContext.$data = undefined;
    3.96 +$parentContext.$data = undefined;
    3.97  var $parent = undefined;
    3.98  var $parents = [];
    3.99 -var $element;
   3.100  var $data = ko.$bindings;
   3.101 -with (ko.$bindings) {
   3.102 +with ($data) {
   3.103  (pepa);}
   3.104  });
   3.105  (function(){
   3.106 +var $element;
   3.107  var $root = ko.$bindings;
   3.108 +var $parentContext = {
   3.109 +$parentContext :undefined,
   3.110 +$root : ko.$bindings,
   3.111 +};
   3.112 +var $context = {
   3.113 +$parentContext :{
   3.114 +$parentContext :undefined,
   3.115 +$root : ko.$bindings,
   3.116 +},
   3.117 +$root : ko.$bindings,
   3.118 +};
   3.119  var $parent = ko.$bindings;
   3.120 -var $parents = [ko.$bindings];
   3.121 -var $element;
   3.122 +$context.$parentContext.$data = ko.$bindings;
   3.123 +$parentContext.$data = ko.$bindings;
   3.124 +var $parents = [$parentContext.$data];
   3.125  with (ko.$bindings) {
   3.126  var $data = pepa;
   3.127 -with (pepa) {
   3.128 +}
   3.129 +with ($data) {
   3.130  (jmeno);}
   3.131 -}
   3.132  });
     4.1 --- a/html.knockout/test/unit/data/KOTestProject/public_html/simple.html.virtual	Tue Aug 13 14:01:33 2013 +0200
     4.2 +++ b/html.knockout/test/unit/data/KOTestProject/public_html/simple.html.virtual	Tue Aug 13 14:38:34 2013 +0200
     4.3 @@ -3,20 +3,34 @@
     4.4  __netbeans_import__('js/simple_model.js');
     4.5  
     4.6  (function(){
     4.7 +var $element;
     4.8  var $root = ko.$bindings;
     4.9 +var $parentContext = undefined;
    4.10 +var $context = {
    4.11 +$parentContext :undefined,
    4.12 +$root : ko.$bindings,
    4.13 +};
    4.14 +$context.$parentContext.$data = undefined;
    4.15 +$parentContext.$data = undefined;
    4.16  var $parent = undefined;
    4.17  var $parents = [];
    4.18 -var $element;
    4.19  var $data = ko.$bindings;
    4.20 -with (ko.$bindings) {
    4.21 +with ($data) {
    4.22  (addSeat);}
    4.23  });
    4.24  (function(){
    4.25 +var $element;
    4.26  var $root = ko.$bindings;
    4.27 +var $parentContext = undefined;
    4.28 +var $context = {
    4.29 +$parentContext :undefined,
    4.30 +$root : ko.$bindings,
    4.31 +};
    4.32 +$context.$parentContext.$data = undefined;
    4.33 +$parentContext.$data = undefined;
    4.34  var $parent = undefined;
    4.35  var $parents = [];
    4.36 -var $element;
    4.37  var $data = ko.$bindings;
    4.38 -with (ko.$bindings) {
    4.39 +with ($data) {
    4.40  (seats().length < 5);}
    4.41  });
     5.1 --- a/html.knockout/test/unit/data/completion/foreach/index.html.testForEach.completion	Tue Aug 13 14:01:33 2013 +0200
     5.2 +++ b/html.knockout/test/unit/data/completion/foreach/index.html.testForEach.completion	Tue Aug 13 14:38:34 2013 +0200
     5.3 @@ -4,19 +4,20 @@
     5.4  ------------------------------------
     5.5  CONSTRUCTO Bulici(): Bulici                [PUBLIC]   index.html
     5.6  CONSTRUCTO Clobrda(jmeno): Clobrda         [PUBLIC]   index.html
     5.7 +CLASS      $context                        [PRIVATE]  index.html
     5.8 +CLASS      $parentContext                  [PRIVATE]  index.html
     5.9  CLASS      ko                              [PUBLIC]   Knockout
    5.10  METHOD     init(): undefined               [PUBLIC]   index.html
    5.11  FIELD      age: Number                     [PUBLIC]   index.html
    5.12  FIELD      jmeno                           [PUBLIC]   index.html
    5.13 -FIELD      lidickove: Array                [PUBLIC]   index.html
    5.14 -FIELD      pepa: Clobrda                   [PUBLIC]   index.html
    5.15 -VARIABLE   $data                           [PRIVATE]  index.html
    5.16 +VARIABLE   $data: ko.$bindings@with;_L35.  [PRIVATE]  index.html
    5.17  VARIABLE   $element                        [PRIVATE]  index.html
    5.18  VARIABLE   $index: Number                  [PRIVATE]  index.html
    5.19  VARIABLE   $parent: ko.$bindings           [PRIVATE]  index.html
    5.20  VARIABLE   $parents: Array                 [PRIVATE]  index.html
    5.21  VARIABLE   $root: ko.$bindings             [PRIVATE]  index.html
    5.22  VARIABLE   arguments: Arguments            [PRIVATE]  index.html
    5.23 +VARIABLE   lidickove                       [PUBLIC]   index.html
    5.24  VARIABLE   undefined                       [PUBLIC]   index.html
    5.25  KEYWORD    break                                      null
    5.26  KEYWORD    case                                       null
     6.1 --- a/html.knockout/test/unit/data/completion/foreach/index.html.virtual	Tue Aug 13 14:01:33 2013 +0200
     6.2 +++ b/html.knockout/test/unit/data/completion/foreach/index.html.virtual	Tue Aug 13 14:38:34 2013 +0200
     6.3 @@ -17,56 +17,111 @@
     6.4  init();;
     6.5  });
     6.6  (function(){
     6.7 +var $element;
     6.8  var $root = ko.$bindings;
     6.9 +var $parentContext = undefined;
    6.10 +var $context = {
    6.11 +$parentContext :undefined,
    6.12 +$root : ko.$bindings,
    6.13 +};
    6.14 +$context.$parentContext.$data = undefined;
    6.15 +$parentContext.$data = undefined;
    6.16  var $parent = undefined;
    6.17  var $parents = [];
    6.18 -var $element;
    6.19  var $data = ko.$bindings;
    6.20 -with (ko.$bindings) {
    6.21 +with ($data) {
    6.22  (lidickove );}
    6.23  });
    6.24  (function(){
    6.25 +var $element;
    6.26  var $root = ko.$bindings;
    6.27 +var $index = 0;
    6.28 +var $parentContext = {
    6.29 +$parentContext :undefined,
    6.30 +$root : ko.$bindings,
    6.31 +};
    6.32 +var $context = {
    6.33 +$parentContext :{
    6.34 +$parentContext :undefined,
    6.35 +$root : ko.$bindings,
    6.36 +},
    6.37 +$root : ko.$bindings,
    6.38 +$index : 0,
    6.39 +};
    6.40  var $parent = ko.$bindings;
    6.41 -var $parents = [ko.$bindings];
    6.42 -var $index = 0;
    6.43 -var $element;
    6.44 +$context.$parentContext.$data = ko.$bindings;
    6.45 +$parentContext.$data = ko.$bindings;
    6.46 +var $parents = [$parentContext.$data];
    6.47  with (ko.$bindings) {
    6.48  var $data = lidickove[0];
    6.49 -with (lidickove[0]) {
    6.50 +}
    6.51 +with ($data) {
    6.52  (  );}
    6.53 -}
    6.54  });
    6.55  (function(){
    6.56 +var $element;
    6.57  var $root = ko.$bindings;
    6.58 +var $index = 0;
    6.59 +var $parentContext = {
    6.60 +$parentContext :undefined,
    6.61 +$root : ko.$bindings,
    6.62 +};
    6.63 +var $context = {
    6.64 +$parentContext :{
    6.65 +$parentContext :undefined,
    6.66 +$root : ko.$bindings,
    6.67 +},
    6.68 +$root : ko.$bindings,
    6.69 +$index : 0,
    6.70 +};
    6.71  var $parent = ko.$bindings;
    6.72 -var $parents = [ko.$bindings];
    6.73 -var $index = 0;
    6.74 -var $element;
    6.75 +$context.$parentContext.$data = ko.$bindings;
    6.76 +$parentContext.$data = ko.$bindings;
    6.77 +var $parents = [$parentContext.$data];
    6.78  with (ko.$bindings) {
    6.79  var $data = lidickove[0];
    6.80 -with (lidickove[0]) {
    6.81 +}
    6.82 +with ($data) {
    6.83  (jmeno == 'pepa' ? 'jouda' :
    6.84  'king');}
    6.85 -}
    6.86  });
    6.87  (function(){
    6.88 +var $element;
    6.89  var $root = ko.$bindings;
    6.90 +var $parentContext = undefined;
    6.91 +var $context = {
    6.92 +$parentContext :undefined,
    6.93 +$root : ko.$bindings,
    6.94 +};
    6.95 +$context.$parentContext.$data = undefined;
    6.96 +$parentContext.$data = undefined;
    6.97  var $parent = undefined;
    6.98  var $parents = [];
    6.99 -var $element;
   6.100  var $data = ko.$bindings;
   6.101 -with (ko.$bindings) {
   6.102 +with ($data) {
   6.103  (pepa);}
   6.104  });
   6.105  (function(){
   6.106 +var $element;
   6.107  var $root = ko.$bindings;
   6.108 +var $parentContext = {
   6.109 +$parentContext :undefined,
   6.110 +$root : ko.$bindings,
   6.111 +};
   6.112 +var $context = {
   6.113 +$parentContext :{
   6.114 +$parentContext :undefined,
   6.115 +$root : ko.$bindings,
   6.116 +},
   6.117 +$root : ko.$bindings,
   6.118 +};
   6.119  var $parent = ko.$bindings;
   6.120 -var $parents = [ko.$bindings];
   6.121 -var $element;
   6.122 +$context.$parentContext.$data = ko.$bindings;
   6.123 +$parentContext.$data = ko.$bindings;
   6.124 +var $parents = [$parentContext.$data];
   6.125  with (ko.$bindings) {
   6.126  var $data = pepa;
   6.127 -with (pepa) {
   6.128 +}
   6.129 +with ($data) {
   6.130  (jmeno);}
   6.131 -}
   6.132  });
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/html.knockout/test/unit/data/completion/inner/index.html	Tue Aug 13 14:38:34 2013 +0200
     7.3 @@ -0,0 +1,36 @@
     7.4 +<!DOCTYPE html>
     7.5 +<html>
     7.6 +    <head>
     7.7 +        <title></title>
     7.8 +        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     7.9 +        <link
    7.10 +href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,700,900"
    7.11 +rel="stylesheet" />
    7.12 +        <link href="styles/expenses.css" rel="stylesheet"/>
    7.13 +        <style>
    7.14 +            .jouda { color: red; }
    7.15 +            .king { color: green; }
    7.16 +        </style>
    7.17 +        <script src="libs/knockout-2.2.1.js"></script>
    7.18 +        <script>
    7.19 +            function Bulici() {
    7.20 +                this.pepa = new Clobrda("pepa");
    7.21 +                this.lidickove = [ this.pepa, new Clobrda("jozin")];
    7.22 +            }
    7.23 +            function Clobrda(jmeno) {
    7.24 +                this.jmeno = jmeno;
    7.25 +                this.age = 1;
    7.26 +            }
    7.27 +            function init() {
    7.28 +                ko.applyBindings(new Bulici());
    7.29 +            }
    7.30 +        </script>
    7.31 +    </head>
    7.32 +    <body onload="init();">
    7.33 +        <span data-bind="foreach: lidickove ">
    7.34 +            <span data-bind="with: jmeno">
    7.35 +                <div data-bind="text: length"></div>
    7.36 +            </span>
    7.37 +        </span>
    7.38 +    </body>
    7.39 +</html>
    7.40 \ No newline at end of file
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/html.knockout/test/unit/data/completion/inner/index.html.virtual	Tue Aug 13 14:38:34 2013 +0200
     8.3 @@ -0,0 +1,96 @@
     8.4 +__netbeans_import__('libs/knockout-2.2.1.js');
     8.5 +
     8.6 +
     8.7 +            function Bulici() {
     8.8 +                this.pepa = new Clobrda("pepa");
     8.9 +                this.lidickove = [ this.pepa, new Clobrda("jozin")];
    8.10 +            }
    8.11 +            function Clobrda(jmeno) {
    8.12 +                this.jmeno = jmeno;
    8.13 +                this.age = 1;
    8.14 +            }
    8.15 +            function init() {
    8.16 +                ko.applyBindings(new Bulici());
    8.17 +            }
    8.18 +        
    8.19 +(function(){
    8.20 +init();;
    8.21 +});
    8.22 +(function(){
    8.23 +var $element;
    8.24 +var $root = ko.$bindings;
    8.25 +var $parentContext = undefined;
    8.26 +var $context = {
    8.27 +$parentContext :undefined,
    8.28 +$root : ko.$bindings,
    8.29 +};
    8.30 +$context.$parentContext.$data = undefined;
    8.31 +$parentContext.$data = undefined;
    8.32 +var $parent = undefined;
    8.33 +var $parents = [];
    8.34 +var $data = ko.$bindings;
    8.35 +with ($data) {
    8.36 +(lidickove );}
    8.37 +});
    8.38 +(function(){
    8.39 +var $element;
    8.40 +var $root = ko.$bindings;
    8.41 +var $index = 0;
    8.42 +var $parentContext = {
    8.43 +$parentContext :undefined,
    8.44 +$root : ko.$bindings,
    8.45 +};
    8.46 +var $context = {
    8.47 +$parentContext :{
    8.48 +$parentContext :undefined,
    8.49 +$root : ko.$bindings,
    8.50 +},
    8.51 +$root : ko.$bindings,
    8.52 +$index : 0,
    8.53 +};
    8.54 +var $parent = ko.$bindings;
    8.55 +$context.$parentContext.$data = ko.$bindings;
    8.56 +$parentContext.$data = ko.$bindings;
    8.57 +var $parents = [$parentContext.$data];
    8.58 +with (ko.$bindings) {
    8.59 +var $data = lidickove[0];
    8.60 +}
    8.61 +with ($data) {
    8.62 +(jmeno);}
    8.63 +});
    8.64 +(function(){
    8.65 +var $element;
    8.66 +var $root = ko.$bindings;
    8.67 +var $parentContext = {
    8.68 +$parentContext :{
    8.69 +$parentContext :undefined,
    8.70 +$root : ko.$bindings,
    8.71 +},
    8.72 +$root : ko.$bindings,
    8.73 +};
    8.74 +var $context = {
    8.75 +$parentContext :{
    8.76 +$parentContext :{
    8.77 +$parentContext :undefined,
    8.78 +$root : ko.$bindings,
    8.79 +},
    8.80 +$root : ko.$bindings,
    8.81 +},
    8.82 +$root : ko.$bindings,
    8.83 +};
    8.84 +with (ko.$bindings) {
    8.85 +var $parent = lidickove[0];
    8.86 +$context.$parentContext.$data = lidickove[0];
    8.87 +$parentContext.$data = lidickove[0];
    8.88 +}
    8.89 +$context.$parentContext.$parentContext.$data = ko.$bindings;
    8.90 +$parentContext.$parentContext.$data = ko.$bindings;
    8.91 +var $parents = [$parentContext.$parentContext.$data,$parentContext.$data];
    8.92 +with (ko.$bindings) {
    8.93 +with (lidickove[0]) {
    8.94 +var $data = jmeno;
    8.95 +}
    8.96 +}
    8.97 +with ($data) {
    8.98 +(length);}
    8.99 +});
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/html.knockout/test/unit/data/completion/issue231569/index.html.testIssue231569.completion	Tue Aug 13 14:38:34 2013 +0200
     9.3 @@ -0,0 +1,46 @@
     9.4 +Code completion result for source line:
     9.5 +<input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: | }' /></input>
     9.6 +(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
     9.7 +------------------------------------
     9.8 +CONSTRUCTO TestModel(lists, selectedList)  [PUBLIC]   index.html
     9.9 +CLASS      $context                        [PRIVATE]  index.html
    9.10 +CLASS      $parentContext                  [PRIVATE]  index.html
    9.11 +CLASS      UNKNOWN                         [PUBLIC]   index.html
    9.12 +CLASS      ko                              [PUBLIC]   Knockout
    9.13 +VARIABLE   $data: ko.$bindings             [PRIVATE]  index.html
    9.14 +VARIABLE   $element                        [PRIVATE]  index.html
    9.15 +VARIABLE   $parent: undefined              [PRIVATE]  index.html
    9.16 +VARIABLE   $parents: Array                 [PRIVATE]  index.html
    9.17 +VARIABLE   $root: ko.$bindings             [PRIVATE]  index.html
    9.18 +VARIABLE   arguments: Arguments            [PRIVATE]  index.html
    9.19 +VARIABLE   savedLists                      [PUBLIC]   index.html
    9.20 +VARIABLE   undefined                       [PUBLIC]   index.html
    9.21 +VARIABLE   userNameToAdd                   [PUBLIC]   index.html
    9.22 +KEYWORD    break                                      null
    9.23 +KEYWORD    case                                       null
    9.24 +KEYWORD    catch                                      null
    9.25 +KEYWORD    continue                                   null
    9.26 +KEYWORD    debugger                                   null
    9.27 +KEYWORD    default                                    null
    9.28 +KEYWORD    delete                                     null
    9.29 +KEYWORD    do                                         null
    9.30 +KEYWORD    else                                       null
    9.31 +KEYWORD    false                                      null
    9.32 +KEYWORD    finally                                    null
    9.33 +KEYWORD    for                                        null
    9.34 +KEYWORD    function                                   null
    9.35 +KEYWORD    if                                         null
    9.36 +KEYWORD    in                                         null
    9.37 +KEYWORD    instanceof                                 null
    9.38 +KEYWORD    new                                        null
    9.39 +KEYWORD    return                                     null
    9.40 +KEYWORD    switch                                     null
    9.41 +KEYWORD    this                                       null
    9.42 +KEYWORD    throw                                      null
    9.43 +KEYWORD    true                                       null
    9.44 +KEYWORD    try                                        null
    9.45 +KEYWORD    typeof                                     null
    9.46 +KEYWORD    var                                        null
    9.47 +KEYWORD    void                                       null
    9.48 +KEYWORD    while                                      null
    9.49 +KEYWORD    with                                       null
    10.1 --- a/html.knockout/test/unit/data/completion/issue231569/index.html.testIssue234569.completion	Tue Aug 13 14:01:33 2013 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,45 +0,0 @@
    10.4 -Code completion result for source line:
    10.5 -<input data-bind='value: userNameToAdd, valueUpdate: "keyup", css: { invalid: | }' /></input>
    10.6 -(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
    10.7 -------------------------------------
    10.8 -CONSTRUCTO TestModel(lists, selectedList)  [PUBLIC]   index.html
    10.9 -CLASS      UNKNOWN                         [PUBLIC]   index.html
   10.10 -CLASS      ko                              [PUBLIC]   Knockout
   10.11 -FIELD      savedLists                      [PUBLIC]   index.html
   10.12 -FIELD      userNameToAddIsValid            [PUBLIC]   index.html
   10.13 -VARIABLE   $data: ko.$bindings             [PRIVATE]  index.html
   10.14 -VARIABLE   $element                        [PRIVATE]  index.html
   10.15 -VARIABLE   $parent: undefined              [PRIVATE]  index.html
   10.16 -VARIABLE   $parents: Array                 [PRIVATE]  index.html
   10.17 -VARIABLE   $root: ko.$bindings             [PRIVATE]  index.html
   10.18 -VARIABLE   arguments: Arguments            [PRIVATE]  index.html
   10.19 -VARIABLE   undefined                       [PUBLIC]   index.html
   10.20 -VARIABLE   userNameToAdd                   [PUBLIC]   index.html
   10.21 -KEYWORD    break                                      null
   10.22 -KEYWORD    case                                       null
   10.23 -KEYWORD    catch                                      null
   10.24 -KEYWORD    continue                                   null
   10.25 -KEYWORD    debugger                                   null
   10.26 -KEYWORD    default                                    null
   10.27 -KEYWORD    delete                                     null
   10.28 -KEYWORD    do                                         null
   10.29 -KEYWORD    else                                       null
   10.30 -KEYWORD    false                                      null
   10.31 -KEYWORD    finally                                    null
   10.32 -KEYWORD    for                                        null
   10.33 -KEYWORD    function                                   null
   10.34 -KEYWORD    if                                         null
   10.35 -KEYWORD    in                                         null
   10.36 -KEYWORD    instanceof                                 null
   10.37 -KEYWORD    new                                        null
   10.38 -KEYWORD    return                                     null
   10.39 -KEYWORD    switch                                     null
   10.40 -KEYWORD    this                                       null
   10.41 -KEYWORD    throw                                      null
   10.42 -KEYWORD    true                                       null
   10.43 -KEYWORD    try                                        null
   10.44 -KEYWORD    typeof                                     null
   10.45 -KEYWORD    var                                        null
   10.46 -KEYWORD    void                                       null
   10.47 -KEYWORD    while                                      null
   10.48 -KEYWORD    with                                       null
    11.1 --- a/html.knockout/test/unit/data/completion/with/index.html.testWith.completion	Tue Aug 13 14:01:33 2013 +0200
    11.2 +++ b/html.knockout/test/unit/data/completion/with/index.html.testWith.completion	Tue Aug 13 14:38:34 2013 +0200
    11.3 @@ -4,18 +4,19 @@
    11.4  ------------------------------------
    11.5  CONSTRUCTO Bulici(): Bulici                [PUBLIC]   index.html
    11.6  CONSTRUCTO Clobrda(jmeno): Clobrda         [PUBLIC]   index.html
    11.7 +CLASS      $context                        [PRIVATE]  index.html
    11.8 +CLASS      $parentContext                  [PRIVATE]  index.html
    11.9  CLASS      ko                              [PUBLIC]   Knockout
   11.10  METHOD     init(): undefined               [PUBLIC]   index.html
   11.11  FIELD      age: Number                     [PUBLIC]   index.html
   11.12  FIELD      jmeno                           [PUBLIC]   index.html
   11.13 -FIELD      lidickove: Array                [PUBLIC]   index.html
   11.14 -FIELD      pepa: Clobrda                   [PUBLIC]   index.html
   11.15 -VARIABLE   $data: pepa                     [PRIVATE]  index.html
   11.16 +VARIABLE   $data: ko.$bindings@with;_L104  [PRIVATE]  index.html
   11.17  VARIABLE   $element                        [PRIVATE]  index.html
   11.18  VARIABLE   $parent: ko.$bindings           [PRIVATE]  index.html
   11.19  VARIABLE   $parents: Array                 [PRIVATE]  index.html
   11.20  VARIABLE   $root: ko.$bindings             [PRIVATE]  index.html
   11.21  VARIABLE   arguments: Arguments            [PRIVATE]  index.html
   11.22 +VARIABLE   lidickove                       [PUBLIC]   index.html
   11.23  VARIABLE   undefined                       [PUBLIC]   index.html
   11.24  KEYWORD    break                                      null
   11.25  KEYWORD    case                                       null
    12.1 --- a/html.knockout/test/unit/data/completion/with/index.html.virtual	Tue Aug 13 14:01:33 2013 +0200
    12.2 +++ b/html.knockout/test/unit/data/completion/with/index.html.virtual	Tue Aug 13 14:38:34 2013 +0200
    12.3 @@ -17,56 +17,111 @@
    12.4  init();;
    12.5  });
    12.6  (function(){
    12.7 +var $element;
    12.8  var $root = ko.$bindings;
    12.9 +var $parentContext = undefined;
   12.10 +var $context = {
   12.11 +$parentContext :undefined,
   12.12 +$root : ko.$bindings,
   12.13 +};
   12.14 +$context.$parentContext.$data = undefined;
   12.15 +$parentContext.$data = undefined;
   12.16  var $parent = undefined;
   12.17  var $parents = [];
   12.18 -var $element;
   12.19  var $data = ko.$bindings;
   12.20 -with (ko.$bindings) {
   12.21 +with ($data) {
   12.22  (lidickove );}
   12.23  });
   12.24  (function(){
   12.25 +var $element;
   12.26  var $root = ko.$bindings;
   12.27 +var $index = 0;
   12.28 +var $parentContext = {
   12.29 +$parentContext :undefined,
   12.30 +$root : ko.$bindings,
   12.31 +};
   12.32 +var $context = {
   12.33 +$parentContext :{
   12.34 +$parentContext :undefined,
   12.35 +$root : ko.$bindings,
   12.36 +},
   12.37 +$root : ko.$bindings,
   12.38 +$index : 0,
   12.39 +};
   12.40  var $parent = ko.$bindings;
   12.41 -var $parents = [ko.$bindings];
   12.42 -var $index = 0;
   12.43 -var $element;
   12.44 +$context.$parentContext.$data = ko.$bindings;
   12.45 +$parentContext.$data = ko.$bindings;
   12.46 +var $parents = [$parentContext.$data];
   12.47  with (ko.$bindings) {
   12.48  var $data = lidickove[0];
   12.49 -with (lidickove[0]) {
   12.50 +}
   12.51 +with ($data) {
   12.52  (jmeno);}
   12.53 -}
   12.54  });
   12.55  (function(){
   12.56 +var $element;
   12.57  var $root = ko.$bindings;
   12.58 +var $index = 0;
   12.59 +var $parentContext = {
   12.60 +$parentContext :undefined,
   12.61 +$root : ko.$bindings,
   12.62 +};
   12.63 +var $context = {
   12.64 +$parentContext :{
   12.65 +$parentContext :undefined,
   12.66 +$root : ko.$bindings,
   12.67 +},
   12.68 +$root : ko.$bindings,
   12.69 +$index : 0,
   12.70 +};
   12.71  var $parent = ko.$bindings;
   12.72 -var $parents = [ko.$bindings];
   12.73 -var $index = 0;
   12.74 -var $element;
   12.75 +$context.$parentContext.$data = ko.$bindings;
   12.76 +$parentContext.$data = ko.$bindings;
   12.77 +var $parents = [$parentContext.$data];
   12.78  with (ko.$bindings) {
   12.79  var $data = lidickove[0];
   12.80 -with (lidickove[0]) {
   12.81 +}
   12.82 +with ($data) {
   12.83  (jmeno == 'pepa' ? 'jouda' :
   12.84  'king');}
   12.85 -}
   12.86  });
   12.87  (function(){
   12.88 +var $element;
   12.89  var $root = ko.$bindings;
   12.90 +var $parentContext = undefined;
   12.91 +var $context = {
   12.92 +$parentContext :undefined,
   12.93 +$root : ko.$bindings,
   12.94 +};
   12.95 +$context.$parentContext.$data = undefined;
   12.96 +$parentContext.$data = undefined;
   12.97  var $parent = undefined;
   12.98  var $parents = [];
   12.99 -var $element;
  12.100  var $data = ko.$bindings;
  12.101 -with (ko.$bindings) {
  12.102 +with ($data) {
  12.103  (pepa);}
  12.104  });
  12.105  (function(){
  12.106 +var $element;
  12.107  var $root = ko.$bindings;
  12.108 +var $parentContext = {
  12.109 +$parentContext :undefined,
  12.110 +$root : ko.$bindings,
  12.111 +};
  12.112 +var $context = {
  12.113 +$parentContext :{
  12.114 +$parentContext :undefined,
  12.115 +$root : ko.$bindings,
  12.116 +},
  12.117 +$root : ko.$bindings,
  12.118 +};
  12.119  var $parent = ko.$bindings;
  12.120 -var $parents = [ko.$bindings];
  12.121 -var $element;
  12.122 +$context.$parentContext.$data = ko.$bindings;
  12.123 +$parentContext.$data = ko.$bindings;
  12.124 +var $parents = [$parentContext.$data];
  12.125  with (ko.$bindings) {
  12.126  var $data = pepa;
  12.127 -with (pepa) {
  12.128 +}
  12.129 +with ($data) {
  12.130  ( );}
  12.131 -}
  12.132  });
    13.1 --- a/html.knockout/test/unit/src/org/netbeans/modules/html/knockout/KOCodeCompletionTest.java	Tue Aug 13 14:01:33 2013 +0200
    13.2 +++ b/html.knockout/test/unit/src/org/netbeans/modules/html/knockout/KOCodeCompletionTest.java	Tue Aug 13 14:38:34 2013 +0200
    13.3 @@ -71,7 +71,7 @@
    13.4          checkCompletion("completion/with/index.html", "            <div data-bind=\"text: ^\"></div>", false);
    13.5      }
    13.6  
    13.7 -    public void testIssue234569() throws Exception {
    13.8 +    public void testIssue231569() throws Exception {
    13.9          checkCompletion("completion/issue231569/index.html", "                <input data-bind='value: userNameToAdd, valueUpdate: \"keyup\", css: { invalid: ^ }' /></input>", false);
   13.10      }
   13.11  }
    14.1 --- a/html.knockout/test/unit/src/org/netbeans/modules/html/knockout/KOJsEmbeddingProviderPluginTest.java	Tue Aug 13 14:01:33 2013 +0200
    14.2 +++ b/html.knockout/test/unit/src/org/netbeans/modules/html/knockout/KOJsEmbeddingProviderPluginTest.java	Tue Aug 13 14:38:34 2013 +0200
    14.3 @@ -91,6 +91,10 @@
    14.4          checkVirtualSource("completion/with/index.html");
    14.5      }
    14.6  
    14.7 +    public void testInner() throws Exception {
    14.8 +        checkVirtualSource("completion/inner/index.html");
    14.9 +    }
   14.10 +
   14.11      public void testDoNotCreateKOVirtualSourceForPlainFiles() {
   14.12          FileObject index = getTestFile("KOTestProject/public_html/plain.html");
   14.13          BaseDocument document = getDocument(index);
    15.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsCodeCompletion.java	Tue Aug 13 14:01:33 2013 +0200
    15.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/JsCodeCompletion.java	Tue Aug 13 14:38:34 2013 +0200
    15.3 @@ -99,6 +99,7 @@
    15.4      public CodeCompletionResult complete(CodeCompletionContext ccContext) {
    15.5          long start = System.currentTimeMillis();
    15.6          
    15.7 +        
    15.8          BaseDocument doc = (BaseDocument) ccContext.getParserResult().getSnapshot().getSource().getDocument(false);
    15.9          if (doc == null) {
   15.10              return CodeCompletionResult.NONE;
   15.11 @@ -135,7 +136,7 @@
   15.12                      for (IndexedElement indexElement : fromIndex) {
   15.13                          addPropertyToMap(request, added, indexElement);
   15.14                      }
   15.15 -                    added.putAll(getWithCompletionResults(request, null));
   15.16 +//                    added.putAll(getWithCompletionResults(request, null));
   15.17                      break;    
   15.18                  case EXPRESSION:
   15.19                      completeKeywords(request, resultList);
   15.20 @@ -191,13 +192,13 @@
   15.21                      for (IndexedElement indexElement : fromIndex) {
   15.22                          addPropertyToMap(request, addedProperties, indexElement);
   15.23                      }
   15.24 -
   15.25 -                    addedProperties.putAll(getWithCompletionResults(request, null));
   15.26 +                    completeInWith(request, added);
   15.27                      JsCompletionItem.Factory.create(addedProperties, request, resultList);
   15.28                      break;
   15.29                  case EXPRESSION:
   15.30                      completeKeywords(request, resultList);
   15.31                      completeExpression(request, added);
   15.32 +                    completeInWith(request, added);
   15.33                      break;
   15.34                  case OBJECT_PROPERTY:
   15.35                      completeObjectProperty(request, added);
   15.36 @@ -454,65 +455,15 @@
   15.37              }
   15.38          }
   15.39  
   15.40 -        addedItems.putAll(getWithCompletionResults(request, null));
   15.41 +//        addedItems.putAll(getWithCompletionResults(request, null));
   15.42      }
   15.43  
   15.44      private int checkRecursion;
   15.45  
   15.46      private void completeObjectProperty(CompletionRequest request, Map<String, List<JsElement>> addedItems) {
   15.47 -        List<String> expChain = resolveExpressionChain(request, request.anchor, false);
   15.48 +        List<String> expChain = ModelUtils.resolveExpressionChain(request.result.getSnapshot(), request.anchor, false);
   15.49          Map<String, List<JsElement>> toAdd = getCompletionFromExpressionChain(request, expChain);
   15.50 -        Map<String, List<JsElement>> toAddWith = getWithCompletionResults(request, expChain);
   15.51          addedItems.putAll(toAdd);
   15.52 -        if (!toAddWith.isEmpty()) {
   15.53 -            addedItems.putAll(toAddWith);
   15.54 -        }
   15.55 -    }
   15.56 -
   15.57 -    private Map<String, List<JsElement>> getWithCompletionResults(CompletionRequest request, @NullAllowed List<String> expChain) {
   15.58 -        Map<String, List<JsElement>> result = new HashMap<String, List<JsElement>>(1);
   15.59 -
   15.60 -        DeclarationScope scope = ModelUtils.getDeclarationScope(request.result.getModel(), request.anchor);
   15.61 -        List<String> realExpChain = expChain;
   15.62 -        if (realExpChain == null) {
   15.63 -            realExpChain = resolveExpressionChain(request, request.anchor, false);
   15.64 -        }
   15.65 -        List<String> combinedChain = new ArrayList<String>();
   15.66 -        while (scope != null) {
   15.67 -            List<? extends TypeUsage> found = scope.getWithTypesForOffset(request.anchor);
   15.68 -
   15.69 -            // we iterate in reverse order (by offset) to from the deepest with up
   15.70 -            for (int i = found.size() - 1; i >= 0; i--) {
   15.71 -                for (TypeUsage resolved : ModelUtils.resolveTypeFromSemiType(
   15.72 -                        ModelUtils.findJsObject(request.result.getModel(), request.anchor), found.get(i))) {
   15.73 -                    List<String> typeChain = ModelUtils.expressionFromType(resolved);
   15.74 -                    if (typeChain.size() == 1) {
   15.75 -                        typeChain = new ArrayList<String>(typeChain);
   15.76 -                        typeChain.add("@pro"); // NOI18N
   15.77 -                    }
   15.78 -                    List<String> workingChain = new ArrayList<String>(typeChain.size() + realExpChain.size() + 2);
   15.79 -                    workingChain.addAll(realExpChain);
   15.80 -                    workingChain.addAll(typeChain);
   15.81 -                    result.putAll(getCompletionFromExpressionChain(request, workingChain));
   15.82 -
   15.83 -                    if (!combinedChain.isEmpty()) {
   15.84 -                        workingChain.clear();
   15.85 -                        workingChain.addAll(combinedChain);
   15.86 -                        workingChain.addAll(typeChain);
   15.87 -                        result.putAll(getCompletionFromExpressionChain(request, workingChain));
   15.88 -                    }
   15.89 -                    combinedChain.addAll(typeChain);                    
   15.90 -                }
   15.91 -            }
   15.92 -
   15.93 -            // FIXME more generic solution
   15.94 -            if ((scope instanceof JsFunction) && !(scope instanceof CatchBlockImpl)) {
   15.95 -                // the with is not propagated to function afaik
   15.96 -                break;
   15.97 -            }
   15.98 -            scope = scope.getParentScope();
   15.99 -        }
  15.100 -        return result;
  15.101      }
  15.102  
  15.103      private Map<String, List<JsElement>> getCompletionFromExpressionChain(CompletionRequest request, List<String> expChain) {
  15.104 @@ -788,7 +739,8 @@
  15.105      }
  15.106      
  15.107      private void completeObjectMembers(JsObject jsObject, CompletionRequest request, Map<String, List<JsElement>> properties) {
  15.108 -        if (jsObject.getJSKind() == JsElement.Kind.OBJECT || jsObject.getJSKind() == JsElement.Kind.CONSTRUCTOR) {
  15.109 +        if (jsObject.getJSKind() == JsElement.Kind.OBJECT || jsObject.getJSKind() == JsElement.Kind.CONSTRUCTOR
  15.110 +                || jsObject.getJSKind() == JsElement.Kind.OBJECT_LITERAL) {
  15.111              for (JsObject property : jsObject.getProperties().values()) {
  15.112                  if(!property.getModifiers().contains(Modifier.PRIVATE) && !property.isAnonymous()) {
  15.113                      addPropertyToMap(request, properties, property);
  15.114 @@ -805,6 +757,30 @@
  15.115          }
  15.116      }
  15.117  
  15.118 +    private void completeInWith (CompletionRequest request,HashMap <String, List<JsElement>> addedItems) {
  15.119 +        int offset = request.anchor;
  15.120 +        Collection<? extends TypeUsage> typesFromWith = ModelUtils.getTypeFromWith(request.result.getModel(), offset);
  15.121 +        if (!typesFromWith.isEmpty()) {
  15.122 +            FileObject fo = request.info.getSnapshot().getSource().getFileObject();
  15.123 +            JsIndex jsIndex = JsIndex.get(fo);
  15.124 +            Collection<TypeUsage> resolveTypes = ModelUtils.resolveTypes(typesFromWith, request.result, true);
  15.125 +            for (TypeUsage type : resolveTypes) {
  15.126 +                JsObject localObject = ModelUtils.findJsObjectByName(request.result.getModel(), type.getType());
  15.127 +                if (localObject != null) {
  15.128 +                    addObjectPropertiesToCC(localObject, request, addedItems);
  15.129 +                } 
  15.130 +                
  15.131 +                Collection<IndexedElement> indexResults = jsIndex.getPropertiesWithPrefix(type.getType(), request.prefix);
  15.132 +                for (IndexedElement indexedElement : indexResults) {
  15.133 +                    if (!indexedElement.isAnonymous()
  15.134 +                            && indexedElement.getModifiers().contains(Modifier.PUBLIC)) {
  15.135 +                        addPropertyToMap(request, addedItems, indexedElement);
  15.136 +                    }
  15.137 +                }
  15.138 +            }
  15.139 +        }
  15.140 +    }
  15.141 +    
  15.142      private void completeKeywords(CompletionRequest request, List<CompletionProposal> resultList) {
  15.143          for (String keyword : JsKeyWords.KEYWORDS.keySet()) {
  15.144              if (startsWith(keyword, request.prefix)) {
    16.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/index/JsIndex.java	Tue Aug 13 14:01:33 2013 +0200
    16.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/index/JsIndex.java	Tue Aug 13 14:38:34 2013 +0200
    16.3 @@ -314,7 +314,7 @@
    16.4      private static Collection<IndexedElement> getElementsByPrefix(String prefix, Collection<IndexedElement> items) {
    16.5          Collection<IndexedElement> result = new ArrayList<IndexedElement>();
    16.6          for (IndexedElement indexedElement : items) {
    16.7 -            if (indexedElement.getFQN().startsWith(prefix)) {
    16.8 +            if (indexedElement.getName().startsWith(prefix)) {
    16.9                  result.add(indexedElement);
   16.10              }
   16.11          }
    17.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/DeclarationScope.java	Tue Aug 13 14:01:33 2013 +0200
    17.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/DeclarationScope.java	Tue Aug 13 14:38:34 2013 +0200
    17.3 @@ -54,14 +54,4 @@
    17.4  
    17.5      Collection<? extends DeclarationScope> getChildrenScopes();
    17.6  
    17.7 -    /**
    17.8 -     * Returns the types used in with blocks which applies to given offset.
    17.9 -     * The returned list is sorted by offset so the outer with block is
   17.10 -     * the first one.
   17.11 -     *
   17.12 -     * @param offset the offset for which we want to get with types
   17.13 -     * @return the types used in with blocks
   17.14 -     */
   17.15 -    List<? extends TypeUsage> getWithTypesForOffset(int offset);
   17.16 -
   17.17  }
    18.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/JsElement.java	Tue Aug 13 14:01:33 2013 +0200
    18.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/JsElement.java	Tue Aug 13 14:38:34 2013 +0200
    18.3 @@ -68,7 +68,8 @@
    18.4          PROPERTY_GETTER(11),
    18.5          PROPERTY_SETTER(12),
    18.6          OBJECT_LITERAL(13),
    18.7 -        CATCH_BLOCK(14);
    18.8 +        CATCH_BLOCK(14),
    18.9 +        WITH_OBJECT(15);
   18.10          
   18.11          private final int id;
   18.12          private static final Map<Integer, Kind> LOOKUP = new HashMap<Integer, Kind>();
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/JsWith.java	Tue Aug 13 14:38:34 2013 +0200
    19.3 @@ -0,0 +1,61 @@
    19.4 +/*
    19.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    19.6 + *
    19.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
    19.8 + *
    19.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   19.10 + * Other names may be trademarks of their respective owners.
   19.11 + *
   19.12 + * The contents of this file are subject to the terms of either the GNU
   19.13 + * General Public License Version 2 only ("GPL") or the Common
   19.14 + * Development and Distribution License("CDDL") (collectively, the
   19.15 + * "License"). You may not use this file except in compliance with the
   19.16 + * License. You can obtain a copy of the License at
   19.17 + * http://www.netbeans.org/cddl-gplv2.html
   19.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   19.19 + * specific language governing permissions and limitations under the
   19.20 + * License.  When distributing the software, include this License Header
   19.21 + * Notice in each file and include the License file at
   19.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   19.23 + * particular file as subject to the "Classpath" exception as provided
   19.24 + * by Oracle in the GPL Version 2 section of the License file that
   19.25 + * accompanied this code. If applicable, add the following below the
   19.26 + * License Header, with the fields enclosed by brackets [] replaced by
   19.27 + * your own identifying information:
   19.28 + * "Portions Copyrighted [year] [name of copyright owner]"
   19.29 + *
   19.30 + * If you wish your version of this file to be governed by only the CDDL
   19.31 + * or only the GPL Version 2, indicate your decision by adding
   19.32 + * "[Contributor] elects to include this software in this distribution
   19.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   19.34 + * single choice of license, a recipient has the option to distribute
   19.35 + * your version of this file under either the CDDL, the GPL Version 2 or
   19.36 + * to extend the choice of license to its licensees as provided above.
   19.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   19.38 + * Version 2 license, then the option applies only if the new code is
   19.39 + * made subject to such option by the copyright holder.
   19.40 + *
   19.41 + * Contributor(s):
   19.42 + *
   19.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
   19.44 + */
   19.45 +package org.netbeans.modules.javascript2.editor.model;
   19.46 +
   19.47 +import java.util.Collection;
   19.48 +
   19.49 +/**
   19.50 + *
   19.51 + * @author Petr Pisl
   19.52 + */
   19.53 +public interface JsWith extends JsObject {
   19.54 +    
   19.55 +    /**
   19.56 +     * 
   19.57 +     * @return collection types that corresponds to the expression in the with ()
   19.58 +     */
   19.59 +    public Collection<TypeUsage> getTypes();
   19.60 +    
   19.61 +    public Collection<? extends JsWith> getInnerWiths();
   19.62 +            
   19.63 +    public JsWith getOuterWith();
   19.64 +}
    20.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/Model.java	Tue Aug 13 14:01:33 2013 +0200
    20.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/Model.java	Tue Aug 13 14:38:34 2013 +0200
    20.3 @@ -63,13 +63,20 @@
    20.4  import java.util.regex.Matcher;
    20.5  import java.util.regex.Pattern;
    20.6  import org.netbeans.api.annotations.common.NullAllowed;
    20.7 +import org.netbeans.api.lexer.Token;
    20.8 +import org.netbeans.api.lexer.TokenSequence;
    20.9  import org.netbeans.modules.csl.api.Modifier;
   20.10  import org.netbeans.modules.csl.api.OffsetRange;
   20.11 +import org.netbeans.modules.javascript2.editor.api.lexer.JsTokenId;
   20.12 +import org.netbeans.modules.javascript2.editor.api.lexer.LexUtilities;
   20.13  import org.netbeans.modules.javascript2.editor.doc.spi.JsDocumentationHolder;
   20.14 +import org.netbeans.modules.javascript2.editor.index.IndexedElement;
   20.15 +import org.netbeans.modules.javascript2.editor.index.JsIndex;
   20.16  import org.netbeans.modules.javascript2.editor.model.impl.AnonymousObject;
   20.17  import org.netbeans.modules.javascript2.editor.model.impl.IdentifierImpl;
   20.18  import org.netbeans.modules.javascript2.editor.model.impl.JsFunctionImpl;
   20.19  import org.netbeans.modules.javascript2.editor.model.impl.JsObjectImpl;
   20.20 +import org.netbeans.modules.javascript2.editor.model.impl.JsWithObjectImpl;
   20.21  import org.netbeans.modules.javascript2.editor.model.impl.ModelUtils;
   20.22  import org.netbeans.modules.javascript2.editor.model.impl.ModelVisitor;
   20.23  import org.netbeans.modules.javascript2.editor.model.impl.ParameterObject;
   20.24 @@ -121,11 +128,17 @@
   20.25      private final UsageBuilder usageBuilder;
   20.26      
   20.27      private ModelVisitor visitor;
   20.28 +    
   20.29 +    /**
   20.30 +     * contains with expression?
   20.31 +     */
   20.32 +    private boolean resolveWithObjects;
   20.33  
   20.34      Model(JsParserResult parserResult) {
   20.35          this.parserResult = parserResult;
   20.36          this.occurrencesSupport = new OccurrencesSupport(this);
   20.37          this.usageBuilder = new UsageBuilder();
   20.38 +        this.resolveWithObjects = false;
   20.39      }
   20.40  
   20.41      private synchronized ModelVisitor getModelVisitor() {
   20.42 @@ -137,7 +150,7 @@
   20.43                  root.accept(visitor);
   20.44              }
   20.45              long startResolve = System.currentTimeMillis();
   20.46 -            resolveLocalTypes(getGlobalObject(), parserResult.getDocumentationHolder());
   20.47 +            resolveLocalTypes(visitor.getGlobalObject(), parserResult.getDocumentationHolder());
   20.48  
   20.49              ModelElementFactory elementFactory = ModelElementFactoryAccessor.getDefault().createModelElementFactory();
   20.50              long startCallingME = System.currentTimeMillis();
   20.51 @@ -157,10 +170,255 @@
   20.52              if(LOGGER.isLoggable(Level.FINE)) {
   20.53                  LOGGER.fine(MessageFormat.format("Building model took {0}ms. Resolving types took {1}ms. Extending model took {2}", new Object[]{(end - start), (startCallingME - startResolve), (end - startCallingME)}));
   20.54              }
   20.55 +        } else if (resolveWithObjects) {
   20.56 +            long start = System.currentTimeMillis();
   20.57 +            resolveWithObjects = false;
   20.58 +            JsIndex jsIndex = JsIndex.get(parserResult.getSnapshot().getSource().getFileObject());
   20.59 +            processWithObjectIn(visitor.getGlobalObject(), jsIndex);
   20.60 +            long end = System.currentTimeMillis();
   20.61 +            System.out.println("resolving with took: " + (end - start));
   20.62          }
   20.63          return visitor;
   20.64      }
   20.65  
   20.66 +    private void processWithObjectIn(JsObject where, JsIndex jsIndex) {
   20.67 +        if (where.getProperties().isEmpty()) {
   20.68 +            return;
   20.69 +        }
   20.70 +        List<JsObject> properties = new ArrayList(where.getProperties().values());
   20.71 +        for (JsObject property : properties) {
   20.72 +            if (property instanceof JsWith) {
   20.73 +                processWithObject((JsWith)property, jsIndex, null);
   20.74 +            } else {
   20.75 +                processWithObjectIn(property, jsIndex);
   20.76 +            }
   20.77 +        }
   20.78 +    }
   20.79 +    
   20.80 +    private void processWithObject(JsWith with, JsIndex jsIndex, List<String> outerExpression) {
   20.81 +        Collection<TypeUsage> withTypes = with.getTypes();
   20.82 +        withTypes.clear();
   20.83 +        Collection<TypeUsage> resolveTypeFromExpression = new ArrayList<TypeUsage>();
   20.84 +        int offset = ((JsWithObjectImpl)with).getExpressionRange().getEnd();
   20.85 +        List<String> ech = ModelUtils.resolveExpressionChain(parserResult.getSnapshot(), offset, false);
   20.86 +        List<String> originalExp = new ArrayList<String>(ech);
   20.87 +        JsObject fromType = null;
   20.88 +        if (outerExpression == null) {
   20.89 +            outerExpression = ech;
   20.90 +            resolveTypeFromExpression.addAll(ModelUtils.resolveTypeFromExpression(this, jsIndex, ech, offset));
   20.91 +            resolveTypeFromExpression = ModelUtils.resolveTypes(resolveTypeFromExpression, parserResult, true);
   20.92 +            withTypes.addAll(resolveTypeFromExpression);
   20.93 +        } else {
   20.94 +            ech.addAll(outerExpression);
   20.95 +            boolean resolved = false;
   20.96 +            resolveTypeFromExpression.addAll(ModelUtils.resolveTypeFromExpression(this, jsIndex, ech, offset));
   20.97 +            resolveTypeFromExpression = ModelUtils.resolveTypes(resolveTypeFromExpression, parserResult, true);
   20.98 +            for(TypeUsage type : resolveTypeFromExpression) {
   20.99 +                fromType = ModelUtils.findJsObjectByName(visitor.getGlobalObject(), type.getType());
  20.100 +                if (fromType != null) {
  20.101 +                    resolved = true;
  20.102 +                    outerExpression = ech;
  20.103 +                    withTypes.add(type);
  20.104 +                    break;
  20.105 +                }
  20.106 +            }
  20.107 +            if (!resolved) {
  20.108 +                resolveTypeFromExpression.clear();
  20.109 +                resolveTypeFromExpression.addAll(ModelUtils.resolveTypeFromExpression(this, jsIndex, originalExp, offset));
  20.110 +                resolveTypeFromExpression = ModelUtils.resolveTypes(resolveTypeFromExpression, parserResult, true);
  20.111 +                for (TypeUsage type : resolveTypeFromExpression) {
  20.112 +                    fromType = ModelUtils.findJsObjectByName(visitor.getGlobalObject(), type.getType());
  20.113 +                    if (fromType != null) {
  20.114 +                        resolved = true;
  20.115 +                        outerExpression = originalExp;
  20.116 +                        withTypes.add(type);
  20.117 +                        break;
  20.118 +                    }
  20.119 +                }
  20.120 +            }
  20.121 +        }
  20.122 +        
  20.123 +        
  20.124 +        for (JsWith innerWith : with.getInnerWiths()) {
  20.125 +            processWithObject(innerWith, jsIndex, outerExpression);
  20.126 +        }
  20.127 +
  20.128 +        for (TypeUsage type : resolveTypeFromExpression) {
  20.129 +            fromType = ModelUtils.findJsObjectByName(visitor.getGlobalObject(), type.getType());
  20.130 +            if (fromType != null) {
  20.131 +                processWithExpressionOccurrences(fromType, ((JsWithObjectImpl)with).getExpressionRange(), originalExp);
  20.132 +                Collection<TypeUsage> assignments = ModelUtils.resolveTypes(fromType.getAssignments(), parserResult, true);
  20.133 +                for (TypeUsage assignment : assignments) {
  20.134 +                    Collection<IndexedElement> properties = jsIndex.getProperties(assignment.getType());
  20.135 +                    for (IndexedElement indexedElement : properties) {
  20.136 +                        JsObject jsWithProperty = with.getProperty(indexedElement.getName());
  20.137 +                        if (jsWithProperty != null) {
  20.138 +                            moveProperty(fromType, jsWithProperty);
  20.139 +                        }
  20.140 +                    }
  20.141 +                }
  20.142 +                
  20.143 +                for (JsObject fromTypeProperty : fromType.getProperties().values()) {
  20.144 +                    JsObject jsWithProperty = with.getProperty(fromTypeProperty.getName());
  20.145 +                    if (jsWithProperty != null) {
  20.146 +                        moveProperty(fromType, jsWithProperty);
  20.147 +                    }
  20.148 +                }
  20.149 +            } else {
  20.150 +                Collection<IndexedElement> properties = jsIndex.getProperties(type.getType());
  20.151 +                if (!properties.isEmpty()) {
  20.152 +                    StringBuilder fqn = new StringBuilder();
  20.153 +                    for (int i =outerExpression.size() - 1; i > -1; i--) {
  20.154 +                        fqn.append(outerExpression.get(--i));
  20.155 +                        fqn.append('.');
  20.156 +                    }
  20.157 +                    if (fqn.length() > 0) {
  20.158 +                        DeclarationScope ds = ModelUtils.getDeclarationScope(with);
  20.159 +                        JsObject fromExpression = ModelUtils.findJsObjectByName((JsObject)ds, fqn.toString());
  20.160 +                        if (fromExpression != null) {
  20.161 +                            for (IndexedElement indexedElement : properties) {
  20.162 +                                JsObject jsWithProperty = with.getProperty(indexedElement.getName());
  20.163 +                                    if (jsWithProperty != null) {
  20.164 +                                        moveProperty(fromExpression, jsWithProperty);
  20.165 +                                    }
  20.166 +                            }
  20.167 +                            processWithExpressionOccurrences(fromExpression, ((JsWithObjectImpl)with).getExpressionRange(), originalExp);
  20.168 +                        }
  20.169 +                    }
  20.170 +                        
  20.171 +                }
  20.172 +            }
  20.173 +        }
  20.174 +        
  20.175 +//        for (TypeUsage typeUsage : withTypes) {
  20.176 +//            for (TypeUsage rType : ModelUtils.resolveTypeFromSemiType(with, typeUsage)) {
  20.177 +//                String type = rType.getType();
  20.178 +//                if (type.startsWith("@exp;")) {
  20.179 +//                    type = type.substring(5);
  20.180 +//                }
  20.181 +//                if (type.contains("@pro;")) {
  20.182 +//                    type = type.replace("@pro;", ".");
  20.183 +//                }
  20.184 +//                JsObject fromType = ModelUtils.findJsObjectByName((JsObject)ModelUtils.getDeclarationScope(with), type);
  20.185 +//                if (fromType != null) {
  20.186 +//                    Collection<TypeUsage> assignments = ModelUtils.resolveTypes(fromType.getAssignments(), parserResult);
  20.187 +//                    for (TypeUsage assignment : assignments) {
  20.188 +//                        Collection<IndexedElement> properties = jsIndex.getProperties(assignment.getType());
  20.189 +//                        for (IndexedElement indexedElement : properties) {
  20.190 +//                            JsObject jsWithProperty = with.getProperty(indexedElement.getName());
  20.191 +//                            if (jsWithProperty != null) {
  20.192 +//                                moveProperty(fromType, jsWithProperty);
  20.193 +//                            }
  20.194 +//                        }
  20.195 +//                    }
  20.196 +//                    
  20.197 +//                    for (TypeUsage typeFE : ModelUtils.resolveTypes(withTypes, parserResult)) {
  20.198 +//                        Collection<IndexedElement> properties = jsIndex.getProperties(typeFE.getType());
  20.199 +//                        for (IndexedElement indexedElement : properties) {
  20.200 +//                            JsObject jsWithProperty = with.getProperty(indexedElement.getName());
  20.201 +//                            if (jsWithProperty != null) {
  20.202 +//                                moveProperty(fromType, jsWithProperty);
  20.203 +//                            }
  20.204 +//                        }
  20.205 +//                    }
  20.206 +//                    
  20.207 +//                    String typeName = rType.getType();
  20.208 +//                    if (!typeName.startsWith("@")) {
  20.209 +//                        typeName = "@exp;" + typeName;
  20.210 +//                    } else if (typeName.startsWith("@var")) {
  20.211 +//                        typeName = "@exp;" + typeName.substring(5);
  20.212 +//                    }
  20.213 +//                    List<String> exp = ModelUtils.expressionFromType(new TypeUsageImpl(typeName));
  20.214 +//                    Collection<TypeUsage> resolveTypeFromExpression2 = ModelUtils.resolveTypeFromExpression(this, jsIndex, exp, typeUsage.getOffset());
  20.215 +//
  20.216 +//                    for (TypeUsage typeFE : resolveTypeFromExpression2) {
  20.217 +//                        Collection<IndexedElement> properties = jsIndex.getProperties(typeFE.getType());
  20.218 +//                        for (IndexedElement indexedElement : properties) {
  20.219 +//                            JsObject jsWithProperty = with.getProperty(indexedElement.getName());
  20.220 +//                            if (jsWithProperty != null) {
  20.221 +//                                moveProperty(fromType, jsWithProperty);
  20.222 +//                            }
  20.223 +//                        }
  20.224 +//                    }
  20.225 +//                }
  20.226 +//
  20.227 +//            }
  20.228 +//            
  20.229 +//        }
  20.230 +            
  20.231 +        boolean hasOuter = with.getOuterWith() != null;
  20.232 +        Collection<? extends JsObject> variables = ModelUtils.getVariables(ModelUtils.getDeclarationScope(with));
  20.233 +        List<JsObject> withProperties = new ArrayList(with.getProperties().values());
  20.234 +        for (JsObject jsWithProperty : withProperties) {
  20.235 +            if (!(jsWithProperty instanceof JsWith)) {
  20.236 +                String name = jsWithProperty.getName();
  20.237 +                boolean moved = false;
  20.238 +                if (hasOuter) {
  20.239 +                    // move the property for one level up
  20.240 +                    moveProperty(with.getOuterWith(), jsWithProperty);
  20.241 +                    moved = true;
  20.242 +                } else {
  20.243 +                    for (JsObject variable : variables) {
  20.244 +                        if (variable.getName().equals(name)) {
  20.245 +                            moveProperty(variable.getParent(), jsWithProperty);
  20.246 +                            moved = true;
  20.247 +                            break;
  20.248 +                        }
  20.249 +                    }
  20.250 +                }
  20.251 +                if (!moved) {
  20.252 +                    // move the property to the global space
  20.253 +                    moveProperty(visitor.getGlobalObject(), jsWithProperty);
  20.254 +                }
  20.255 +            }
  20.256 +        }
  20.257 +    }
  20.258 +    
  20.259 +    private void processWithExpressionOccurrences(JsObject jsObject, OffsetRange expRange, List<String> expression) {
  20.260 +        TokenSequence<? extends JsTokenId> ts = LexUtilities.getJsTokenSequence(parserResult.getSnapshot(), expRange.getEnd());
  20.261 +        if (ts == null) {
  20.262 +            return;
  20.263 +        }
  20.264 +        ts.move(expRange.getEnd());
  20.265 +        if(!ts.movePrevious()) {
  20.266 +            return;
  20.267 +        }
  20.268 +        Token<? extends JsTokenId> token = ts.token();
  20.269 +        JsObject parent = jsObject.getParent();
  20.270 +        for (int i = 0; i < expression.size() - 1; i++) {
  20.271 +            String name = expression.get(i++);
  20.272 +            while ((token.id() != JsTokenId.IDENTIFIER || !(token.id() == JsTokenId.IDENTIFIER && token.text().toString().equals(name))) && ts.offset() > expRange.getStart() && ts.movePrevious()) {
  20.273 +                token = ts.token();
  20.274 +            }
  20.275 +            if (token.id() == JsTokenId.IDENTIFIER && token.text().toString().equals(name)) {
  20.276 +                JsObject property = parent.getProperty(name);
  20.277 +                if (property != null) {
  20.278 +                    property.addOccurrence(new OffsetRange(ts.offset(), ts.offset() + name.length()));
  20.279 +                }
  20.280 +                parent = parent.getParent();
  20.281 +            }
  20.282 +        }
  20.283 +    }
  20.284 +    
  20.285 +    private void moveProperty (JsObject newParent, JsObject property) {
  20.286 +        JsObject newProperty = newParent.getProperty(property.getName());
  20.287 +        System.out.println("moving property: " + property.getName() + " to " + newParent.getName());
  20.288 +        if (property.getParent() != null) {
  20.289 +            property.getParent().getProperties().remove(property.getName());
  20.290 +        }
  20.291 +        if (newProperty == null) {
  20.292 +            ((JsObjectImpl)property).setParent(newParent);
  20.293 +            newParent.addProperty(property.getName(), property);
  20.294 +        } else {
  20.295 +            JsObjectImpl.moveOccurrenceOfProperties((JsObjectImpl) newProperty, property);
  20.296 +            for (Occurrence occurrence : property.getOccurrences()) {
  20.297 +                newProperty.addOccurrence(occurrence.getOffsetRange());
  20.298 +            }
  20.299 +            // the property needs to be resolved again to handle right occurrences
  20.300 +            resolveLocalTypes(newProperty, parserResult.getDocumentationHolder());
  20.301 +        }
  20.302 +    }
  20.303 +    
  20.304      public JsObject getGlobalObject() {
  20.305          return getModelVisitor().getGlobalObject();
  20.306      }
  20.307 @@ -174,7 +432,9 @@
  20.308          DeclarationScope scope = ModelUtils.getDeclarationScope(this, offset);
  20.309          while (scope != null) {
  20.310              for (JsObject object : ((JsObject)scope).getProperties().values()) {
  20.311 -                result.add(object);
  20.312 +                if (!object.isAnonymous()) {
  20.313 +                    result.add(object);
  20.314 +                }
  20.315              }
  20.316              for (JsObject object : ((JsFunction)scope).getParameters()) {
  20.317                  result.add(object);
  20.318 @@ -185,10 +445,13 @@
  20.319      }
  20.320  
  20.321      private void resolveLocalTypes(JsObject object, JsDocumentationHolder docHolder) {
  20.322 -         if(object instanceof JsFunctionImpl) {
  20.323 +        if(object instanceof JsFunctionImpl) {
  20.324              ((JsFunctionImpl)object).resolveTypes(docHolder);
  20.325          } else {
  20.326              ((JsObjectImpl)object).resolveTypes(docHolder);
  20.327 +            if (object instanceof JsWith) {
  20.328 +                resolveWithObjects = true;
  20.329 +            }
  20.330          }
  20.331          ArrayList<JsObject> copy = new ArrayList(object.getProperties().values());
  20.332          for(JsObject property: copy) {
    21.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/OccurrencesSupport.java	Tue Aug 13 14:01:33 2013 +0200
    21.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/OccurrencesSupport.java	Tue Aug 13 14:38:34 2013 +0200
    21.3 @@ -105,7 +105,7 @@
    21.4      private Occurrence findDeclaration (JsObject object, int offset) {
    21.5          Occurrence result = null;
    21.6          JsElement.Kind kind = object.getJSKind();
    21.7 -        if (kind != JsElement.Kind.ANONYMOUS_OBJECT 
    21.8 +        if (kind != JsElement.Kind.ANONYMOUS_OBJECT && kind != JsElement.Kind.WITH_OBJECT
    21.9                  && object.getDeclarationName() != null && object.getDeclarationName().getOffsetRange().containsInclusive(offset)
   21.10                  && !ModelUtils.isGlobal(object)) {
   21.11              if (kind.isPropertyGetterSetter()) {
    22.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/DeclarationScopeImpl.java	Tue Aug 13 14:01:33 2013 +0200
    22.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/DeclarationScopeImpl.java	Tue Aug 13 14:38:34 2013 +0200
    22.3 @@ -44,9 +44,6 @@
    22.4  import java.util.ArrayList;
    22.5  import java.util.Collection;
    22.6  import java.util.List;
    22.7 -import java.util.Map;
    22.8 -import java.util.NavigableMap;
    22.9 -import java.util.TreeMap;
   22.10  import org.netbeans.modules.csl.api.OffsetRange;
   22.11  import org.netbeans.modules.javascript2.editor.model.DeclarationScope;
   22.12  import org.netbeans.modules.javascript2.editor.model.Identifier;
   22.13 @@ -63,8 +60,6 @@
   22.14  
   22.15      private final List<DeclarationScope> childrenScopes;
   22.16  
   22.17 -    private final NavigableMap<Integer, With> withs = new TreeMap<Integer, With>();
   22.18 -
   22.19      public DeclarationScopeImpl(DeclarationScope inScope, JsObject inObject,
   22.20              Identifier name, OffsetRange offsetRange, String mimeType, String sourceLabel) {
   22.21          super(inObject, name, offsetRange, mimeType, sourceLabel);
   22.22 @@ -82,24 +77,6 @@
   22.23          return childrenScopes;
   22.24      }
   22.25  
   22.26 -    @Override
   22.27 -    public List<? extends TypeUsage> getWithTypesForOffset(int offset) {
   22.28 -        Map<Integer, With> found = withs.headMap(offset);
   22.29 -        List<TypeUsage> result = new ArrayList<TypeUsage>(found.size());
   22.30 -        for (With type : found.values()) {
   22.31 -            OffsetRange range = type.getRange();
   22.32 -            if (range.getStart() <= offset && offset <= range.getEnd()) {
   22.33 -                result.addAll(type.getTypes());
   22.34 -            }
   22.35 -        }
   22.36 -        return result;
   22.37 -    }
   22.38 -
   22.39 -    protected void addWithTypes(OffsetRange range, Collection<? extends TypeUsage> types) {
   22.40 -        assert !withs.containsKey(range.getStart());
   22.41 -        withs.put(range.getStart(), new With(range, types));
   22.42 -    }
   22.43 -
   22.44      protected void addDeclaredScope(DeclarationScope scope) {
   22.45          childrenScopes.add(scope);
   22.46      }
    23.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/JsFunctionReference.java	Tue Aug 13 14:01:33 2013 +0200
    23.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/JsFunctionReference.java	Tue Aug 13 14:38:34 2013 +0200
    23.3 @@ -100,8 +100,4 @@
    23.4          return original.getParentScope();
    23.5      }
    23.6  
    23.7 -    @Override
    23.8 -    public List<? extends TypeUsage> getWithTypesForOffset(int offset) {
    23.9 -        return original.getWithTypesForOffset(offset);
   23.10 -    }
   23.11  }
    24.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/JsObjectImpl.java	Tue Aug 13 14:01:33 2013 +0200
    24.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/JsObjectImpl.java	Tue Aug 13 14:38:34 2013 +0200
    24.3 @@ -46,10 +46,7 @@
    24.4  import org.netbeans.modules.csl.api.Modifier;
    24.5  import org.netbeans.modules.csl.api.OffsetRange;
    24.6  import org.netbeans.modules.javascript2.editor.doc.spi.JsDocumentationHolder;
    24.7 -import org.netbeans.modules.javascript2.editor.index.IndexedElement;
    24.8 -import org.netbeans.modules.javascript2.editor.index.JsIndex;
    24.9  import org.netbeans.modules.javascript2.editor.model.*;
   24.10 -import org.netbeans.modules.parsing.spi.indexing.support.IndexResult;
   24.11  
   24.12  /**
   24.13   *
   24.14 @@ -57,7 +54,7 @@
   24.15   */
   24.16  public class JsObjectImpl extends JsElementImpl implements JsObject {
   24.17  
   24.18 -    final private HashMap<String, JsObject> properties = new HashMap<String, JsObject>();
   24.19 +    final protected HashMap<String, JsObject> properties = new HashMap<String, JsObject>();
   24.20      final private Identifier declarationName;
   24.21      private JsObject parent;
   24.22      final private List<Occurrence> occurrences = new ArrayList<Occurrence>();
   24.23 @@ -480,11 +477,11 @@
   24.24          
   24.25      }
   24.26      
   24.27 -    private void clearOccurrences() {
   24.28 +    protected void clearOccurrences() {
   24.29          occurrences.clear();
   24.30      }
   24.31      
   24.32 -    protected void moveOccurrenceOfProperties(JsObjectImpl original, JsObject created) {
   24.33 +    public static void moveOccurrenceOfProperties(JsObjectImpl original, JsObject created) {
   24.34          if (original.equals(created)) {
   24.35              return;
   24.36          }
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/JsWithObjectImpl.java	Tue Aug 13 14:38:34 2013 +0200
    25.3 @@ -0,0 +1,244 @@
    25.4 +package org.netbeans.modules.javascript2.editor.model.impl;
    25.5 +
    25.6 +import java.util.ArrayList;
    25.7 +import java.util.Collection;
    25.8 +import java.util.Collections;
    25.9 +import java.util.EnumSet;
   25.10 +import java.util.HashSet;
   25.11 +import java.util.Set;
   25.12 +import org.netbeans.modules.csl.api.Modifier;
   25.13 +import org.netbeans.modules.csl.api.OffsetRange;
   25.14 +import org.netbeans.modules.javascript2.editor.doc.spi.JsDocumentationHolder;
   25.15 +import org.netbeans.modules.javascript2.editor.model.Identifier;
   25.16 +import org.netbeans.modules.javascript2.editor.model.JsElement;
   25.17 +import org.netbeans.modules.javascript2.editor.model.JsObject;
   25.18 +import org.netbeans.modules.javascript2.editor.model.JsWith;
   25.19 +import org.netbeans.modules.javascript2.editor.model.Occurrence;
   25.20 +import org.netbeans.modules.javascript2.editor.model.TypeUsage;
   25.21 +import static org.netbeans.modules.javascript2.editor.model.impl.JsObjectImpl.findPrototypeChain;
   25.22 +
   25.23 +/*
   25.24 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   25.25 + *
   25.26 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
   25.27 + *
   25.28 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
   25.29 + * Other names may be trademarks of their respective owners.
   25.30 + *
   25.31 + * The contents of this file are subject to the terms of either the GNU
   25.32 + * General Public License Version 2 only ("GPL") or the Common
   25.33 + * Development and Distribution License("CDDL") (collectively, the
   25.34 + * "License"). You may not use this file except in compliance with the
   25.35 + * License. You can obtain a copy of the License at
   25.36 + * http://www.netbeans.org/cddl-gplv2.html
   25.37 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   25.38 + * specific language governing permissions and limitations under the
   25.39 + * License.  When distributing the software, include this License Header
   25.40 + * Notice in each file and include the License file at
   25.41 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
   25.42 + * particular file as subject to the "Classpath" exception as provided
   25.43 + * by Oracle in the GPL Version 2 section of the License file that
   25.44 + * accompanied this code. If applicable, add the following below the
   25.45 + * License Header, with the fields enclosed by brackets [] replaced by
   25.46 + * your own identifying information:
   25.47 + * "Portions Copyrighted [year] [name of copyright owner]"
   25.48 + *
   25.49 + * If you wish your version of this file to be governed by only the CDDL
   25.50 + * or only the GPL Version 2, indicate your decision by adding
   25.51 + * "[Contributor] elects to include this software in this distribution
   25.52 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
   25.53 + * single choice of license, a recipient has the option to distribute
   25.54 + * your version of this file under either the CDDL, the GPL Version 2 or
   25.55 + * to extend the choice of license to its licensees as provided above.
   25.56 + * However, if you add GPL Version 2 code and therefore, elected the GPL
   25.57 + * Version 2 license, then the option applies only if the new code is
   25.58 + * made subject to such option by the copyright holder.
   25.59 + *
   25.60 + * Contributor(s):
   25.61 + *
   25.62 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
   25.63 + */
   25.64 +
   25.65 +/**
   25.66 + *
   25.67 + * @author Petr Pisl
   25.68 + */
   25.69 +public class JsWithObjectImpl extends JsObjectImpl implements JsWith {
   25.70 +
   25.71 +    private Collection<TypeUsage> withTypes;
   25.72 +    private JsWith outerWith;
   25.73 +    private Collection<JsWith> innerWith = new ArrayList<JsWith>();
   25.74 +    private OffsetRange expressionRange;
   25.75 +    private Set<JsObject> assignedIn = new HashSet<JsObject>();
   25.76 +    
   25.77 +    public JsWithObjectImpl(JsObject parent, String name, Collection<TypeUsage> withTypes,
   25.78 +            OffsetRange offsetRange, OffsetRange expressionRange, String mimeType, String sourceLabel) {
   25.79 +        super(parent, name, false, offsetRange, EnumSet.of(Modifier.PUBLIC), mimeType, sourceLabel);
   25.80 +        this.withTypes = withTypes;
   25.81 +//        while (parent != null && !(parent instanceof JsWithObjectImpl)) {
   25.82 +//            parent = parent.getParent();
   25.83 +//        }
   25.84 +        if (parent instanceof JsWith) {
   25.85 +            outerWith = (JsWith)parent;
   25.86 +            ((JsWithObjectImpl)outerWith).addInnerWith(this);
   25.87 +        }
   25.88 +        this.expressionRange = expressionRange;
   25.89 +    }
   25.90 +
   25.91 +    @Override
   25.92 +    public Collection<TypeUsage> getTypes() {
   25.93 +        return withTypes;
   25.94 +    }
   25.95 +    
   25.96 +    protected void addInnerWith(JsWith inner) {
   25.97 +        innerWith.add(inner);
   25.98 +    }
   25.99 +    
  25.100 +    
  25.101 +    @Override
  25.102 +    public Collection<JsWith> getInnerWiths() {
  25.103 +        Collection<JsWith> result = innerWith.isEmpty() ? Collections.EMPTY_LIST : new ArrayList<JsWith>(innerWith);
  25.104 +        return result;
  25.105 +    }
  25.106 +    
  25.107 +    @Override
  25.108 +    public JsWith getOuterWith() {
  25.109 +        return outerWith;
  25.110 +    }
  25.111 +    
  25.112 +    @Override
  25.113 +    public void resolveTypes(JsDocumentationHolder jsDocHolder) {
  25.114 +        Collection<JsObject> withProperties = new ArrayList<JsObject>(getProperties().values());
  25.115 +        for (JsObject withProperty: withProperties) {
  25.116 +            if (resolveWith(this, withProperty)) {
  25.117 +                properties.remove(withProperty.getName());
  25.118 +            }
  25.119 +        }
  25.120 +    }
  25.121 +
  25.122 +    public Collection<JsObject> getObjectWithAssignment() {
  25.123 +        return this.assignedIn;
  25.124 +    }
  25.125 +    
  25.126 +    public void addObjectWithAssignment(JsObject object) {
  25.127 +        this.assignedIn.add(object);
  25.128 +    }
  25.129 +    
  25.130 +    private boolean resolveWith(JsWithObjectImpl withObject, JsObject property) {
  25.131 +        JsObject global = ModelUtils.getGlobalObject(withObject.getParent());
  25.132 +        for (TypeUsage typeUsage : withObject.getTypes()) {
  25.133 +            for (TypeUsage rType : ModelUtils.resolveTypeFromSemiType(withObject, typeUsage)) {
  25.134 +                JsObject fromType = ModelUtils.findJsObjectByName(global, rType.getType());
  25.135 +                if (fromType != null) {
  25.136 +                    JsObject propertyFromType = fromType.getProperty(property.getName());
  25.137 +                    if (propertyFromType == null && withObject.getOuterWith() == null) {
  25.138 +                        propertyFromType = global.getProperty(property.getName());
  25.139 +                    }
  25.140 +                    if (propertyFromType != null) {
  25.141 +                        moveOccurrenceOfObject((JsObjectImpl)propertyFromType, (JsObjectImpl)property);
  25.142 +                        moveFromWith((JsObjectImpl)propertyFromType, (JsObjectImpl)property);
  25.143 +                        return true;
  25.144 +                    } else {
  25.145 +                        JsWith outer = withObject.getOuterWith();
  25.146 +                        if (outer != null) {
  25.147 +                            return resolveWith((JsWithObjectImpl)outer, property);
  25.148 +                        }
  25.149 +                    }
  25.150 +                } else {
  25.151 +                    JsWith outer = withObject.getOuterWith();
  25.152 +                    if (outer != null) {
  25.153 +                        return resolveWith((JsWithObjectImpl)outer, property);
  25.154 +                    }
  25.155 +                }
  25.156 +            }
  25.157 +        }
  25.158 +        return false;
  25.159 +    }
  25.160 +    
  25.161 +    @Override
  25.162 +    public Kind getJSKind() {
  25.163 +        return JsElement.Kind.WITH_OBJECT;
  25.164 +    }
  25.165 +    
  25.166 +    @Override
  25.167 +    public int getOffset() {
  25.168 +        return getOffsetRange().getStart();
  25.169 +    }
  25.170 +
  25.171 +    @Override
  25.172 +    public boolean isAnonymous() {
  25.173 +        return true;
  25.174 +    }
  25.175 +
  25.176 +    public OffsetRange getExpressionRange() {
  25.177 +        return expressionRange;
  25.178 +    }
  25.179 +
  25.180 +    private void moveOccurrenceOfObject(JsObjectImpl original, JsObjectImpl copy) {
  25.181 +        for (Occurrence occurrence: copy.getOccurrences()) {
  25.182 +            original.addOccurrence(occurrence.getOffsetRange());
  25.183 +        }
  25.184 +        copy.clearOccurrences();
  25.185 +    }
  25.186 +    
  25.187 +    protected void moveFromWith(JsObjectImpl original, JsObjectImpl inWith) {
  25.188 +        if (original.equals(inWith)) {
  25.189 +            return;
  25.190 +        }
  25.191 +        if (!original.isDeclared() && inWith.isDeclared()) {
  25.192 +            moveOccurrenceOfObject(inWith, original);
  25.193 +            moveOccurrenceOfProperties(inWith, original);
  25.194 +            inWith.setParent(original.getParent());
  25.195 +            original.getParent().addProperty(original.getName(), inWith);
  25.196 +            return;
  25.197 +        }
  25.198 +        
  25.199 +        Collection<JsObject> prototypeChains = findPrototypeChain(original);
  25.200 +        Collection<JsObject> propertiesCopy = new ArrayList<JsObject>(inWith.getProperties().values());
  25.201 +        for (JsObject withProperty : propertiesCopy) {
  25.202 +            if (withProperty.isDeclared()) {
  25.203 +                boolean accessible = false;
  25.204 +                for (JsObject jsObject : prototypeChains) {
  25.205 +                    JsObject originalProperty = jsObject.getProperty(withProperty.getName());
  25.206 +                    if (originalProperty != null) {
  25.207 +                        accessible = true;
  25.208 +                        break;
  25.209 +                    }
  25.210 +                }
  25.211 +                if (!accessible) {
  25.212 +                    ((JsObjectImpl)withProperty).setParent(original);
  25.213 +                    original.addProperty(withProperty.getName(), withProperty);
  25.214 +                    inWith.properties.remove(withProperty.getName());
  25.215 +                }
  25.216 +            }
  25.217 +        }
  25.218 +        
  25.219 +        for (JsObject jsObject : prototypeChains) {
  25.220 +            for (JsObject origProperty : jsObject.getProperties().values()) {
  25.221 +                if(origProperty.getModifiers().contains(Modifier.PUBLIC)
  25.222 +                        || origProperty.getModifiers().contains(Modifier.PROTECTED)) {
  25.223 +                    JsObjectImpl usedProperty = (JsObjectImpl)inWith.getProperty(origProperty.getName());
  25.224 +                    if (usedProperty != null) {
  25.225 +                        ((JsObjectImpl)origProperty).addOccurrence(usedProperty.getDeclarationName().getOffsetRange());
  25.226 +                        for(Occurrence occur : usedProperty.getOccurrences()) {
  25.227 +                            ((JsObjectImpl)origProperty).addOccurrence(occur.getOffsetRange());
  25.228 +                        }
  25.229 +                        usedProperty.clearOccurrences();
  25.230 +                        if (origProperty.isDeclared() && usedProperty.isDeclared()){
  25.231 +                            usedProperty.setDeclared(false); // the property is not declared here
  25.232 +                        }
  25.233 +                        moveFromWith((JsObjectImpl)origProperty, usedProperty);
  25.234 +                    }
  25.235 +                }
  25.236 +            }
  25.237 +            JsObject prototype = jsObject.getProperty(ModelUtils.PROTOTYPE);
  25.238 +            if (prototype != null) {
  25.239 +                moveFromWith((JsObjectImpl)prototype, inWith);
  25.240 +            }
  25.241 +        }
  25.242 +        
  25.243 +        
  25.244 +    }
  25.245 +    
  25.246 +    
  25.247 +}
    26.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/ModelBuilder.java	Tue Aug 13 14:01:33 2013 +0200
    26.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/ModelBuilder.java	Tue Aug 13 14:38:34 2013 +0200
    26.3 @@ -44,6 +44,7 @@
    26.4  import java.util.Stack;
    26.5  import org.netbeans.modules.javascript2.editor.model.JsFunction;
    26.6  import org.netbeans.modules.javascript2.editor.model.JsObject;
    26.7 +import org.netbeans.modules.javascript2.editor.model.JsWith;
    26.8  
    26.9  /**
   26.10   *
   26.11 @@ -55,13 +56,17 @@
   26.12      private Stack<JsObjectImpl> stack;
   26.13      private Stack<DeclarationScopeImpl> functionStack;
   26.14      private int anonymObjectCount;
   26.15 +    private int withObjectCount;
   26.16 +    private JsWith currentWith;
   26.17      
   26.18      ModelBuilder(JsFunctionImpl globalObject) {
   26.19          this.globalObject = globalObject;
   26.20          this.stack = new Stack<JsObjectImpl>();
   26.21          this.functionStack = new Stack<DeclarationScopeImpl>();
   26.22          anonymObjectCount = 0;
   26.23 +        withObjectCount = 0;
   26.24          setCurrentObject(globalObject);
   26.25 +        currentWith = null;
   26.26      }
   26.27      
   26.28      
   26.29 @@ -102,13 +107,20 @@
   26.30          if (object instanceof DeclarationScopeImpl) {
   26.31              this.functionStack.push((DeclarationScopeImpl)object);
   26.32          }
   26.33 +        if (object instanceof JsWith) {
   26.34 +            this.currentWith = (JsWith)object;
   26.35 +        }
   26.36      }
   26.37      
   26.38      void reset() {
   26.39          if (!stack.empty()) {
   26.40 -            if (stack.pop() instanceof DeclarationScopeImpl && !functionStack.empty()) {
   26.41 +            JsObject object = stack.pop();
   26.42 +            if (object instanceof DeclarationScopeImpl && !functionStack.empty()) {
   26.43                  functionStack.pop();
   26.44              }
   26.45 +            if (object instanceof JsWith && currentWith != null) {
   26.46 +                currentWith = currentWith.getOuterWith();
   26.47 +            }
   26.48          }
   26.49      }
   26.50      
   26.51 @@ -116,9 +128,16 @@
   26.52          return "Anonym$" + anonymObjectCount++;  
   26.53      }
   26.54      
   26.55 +    String getUnigueNameForWithObject() {
   26.56 +        return "With$" + withObjectCount++;  
   26.57 +    }
   26.58 +    
   26.59  //    FunctionScope build(FunctionNode function) {
   26.60  //        FunctionScopeImpl functionScope = ModelElementFactory.create(function, this);
   26.61  //        return functionScope;
   26.62  //    }
   26.63      
   26.64 +    public JsWith getCurrentWith() {
   26.65 +        return currentWith;
   26.66 +    }
   26.67  }
    27.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/ModelUtils.java	Tue Aug 13 14:01:33 2013 +0200
    27.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/ModelUtils.java	Tue Aug 13 14:38:34 2013 +0200
    27.3 @@ -49,14 +49,17 @@
    27.4  import java.util.HashMap;
    27.5  import java.util.HashSet;
    27.6  import java.util.List;
    27.7 +import java.util.Map;
    27.8  import java.util.Set;
    27.9  import java.util.StringTokenizer;
   27.10  import javax.swing.SwingUtilities;
   27.11  import org.netbeans.api.annotations.common.NullAllowed;
   27.12  import org.netbeans.api.lexer.Token;
   27.13 +import org.netbeans.api.lexer.TokenHierarchy;
   27.14  import org.netbeans.api.lexer.TokenSequence;
   27.15  import org.netbeans.modules.csl.api.Modifier;
   27.16  import org.netbeans.modules.csl.api.OffsetRange;
   27.17 +import org.netbeans.modules.javascript2.editor.JsCompletionItem;
   27.18  import org.netbeans.modules.javascript2.editor.doc.spi.JsDocumentationHolder;
   27.19  import org.netbeans.modules.javascript2.editor.embedding.JsEmbeddingProvider;
   27.20  import org.netbeans.modules.javascript2.editor.index.IndexedElement;
   27.21 @@ -69,10 +72,12 @@
   27.22  import org.netbeans.modules.javascript2.editor.model.JsElement;
   27.23  import org.netbeans.modules.javascript2.editor.model.JsFunction;
   27.24  import org.netbeans.modules.javascript2.editor.model.JsObject;
   27.25 +import org.netbeans.modules.javascript2.editor.model.JsWith;
   27.26  import org.netbeans.modules.javascript2.editor.model.Model;
   27.27  import org.netbeans.modules.javascript2.editor.model.Type;
   27.28  import org.netbeans.modules.javascript2.editor.model.TypeUsage;
   27.29  import org.netbeans.modules.javascript2.editor.parser.JsParserResult;
   27.30 +import org.netbeans.modules.parsing.api.Snapshot;
   27.31  import org.netbeans.modules.parsing.spi.indexing.support.IndexResult;
   27.32  import org.openide.filesystems.FileObject;
   27.33  
   27.34 @@ -90,6 +95,8 @@
   27.35      
   27.36      private static final String GENERATED_ANONYM_PREFIX = "Anonym$"; //NOI18N
   27.37      
   27.38 +    private static final List<String> KNOWN_TYPES = Arrays.asList(Type.ARRAY, Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.UNDEFINED);
   27.39 +    
   27.40      public static JsObjectImpl getJsObject (ModelBuilder builder, List<Identifier> fqName, boolean isLHS) {
   27.41          JsObject result = builder.getCurrentObject();
   27.42          JsObject tmpObject = null;
   27.43 @@ -109,15 +116,20 @@
   27.44              }
   27.45          }
   27.46          if (tmpObject == null) {
   27.47 -            DeclarationScope scope = builder.getCurrentDeclarationFunction();
   27.48 -            while (scope != null && tmpObject == null && scope.getParentScope() != null) {
   27.49 -                tmpObject = ((JsFunction)scope).getParameter(firstName);
   27.50 -                scope = scope.getParentScope();
   27.51 -            }
   27.52 -            if (tmpObject == null) {
   27.53 -                tmpObject = builder.getGlobal();
   27.54 +            JsObject current = builder.getCurrentObject();
   27.55 +            if (current instanceof JsWith) {
   27.56 +                tmpObject = current;
   27.57              } else {
   27.58 -                result = tmpObject;
   27.59 +                DeclarationScope scope = builder.getCurrentDeclarationFunction();
   27.60 +                while (scope != null && tmpObject == null && scope.getParentScope() != null) {
   27.61 +                    tmpObject = ((JsFunction)scope).getParameter(firstName);
   27.62 +                    scope = scope.getParentScope();
   27.63 +                }
   27.64 +                if (tmpObject == null) {
   27.65 +                    tmpObject = builder.getGlobal();
   27.66 +                } else {
   27.67 +                    result = tmpObject;
   27.68 +                }
   27.69              }
   27.70          }
   27.71          for (int index = (tmpObject instanceof ParameterObject ? 1 : 0); index < fqName.size() ; index++) {
   27.72 @@ -156,7 +168,8 @@
   27.73              for (JsObject property : jsObject.getProperties().values()) {
   27.74                  JsElement.Kind kind = property.getJSKind();
   27.75                  if (kind == JsElement.Kind.OBJECT || kind == JsElement.Kind.ANONYMOUS_OBJECT || kind == JsElement.Kind.OBJECT_LITERAL
   27.76 -                        || kind == JsElement.Kind.FUNCTION || kind == JsElement.Kind.METHOD || kind == JsElement.Kind.CONSTRUCTOR) {
   27.77 +                        || kind == JsElement.Kind.FUNCTION || kind == JsElement.Kind.METHOD || kind == JsElement.Kind.CONSTRUCTOR
   27.78 +                        || kind == JsElement.Kind.WITH_OBJECT) {
   27.79                      tmpObject = findJsObject(property, offset);
   27.80                  }
   27.81                  if (tmpObject != null) {
   27.82 @@ -351,12 +364,25 @@
   27.83          return result;
   27.84      }
   27.85  
   27.86 -    public static Collection<TypeUsage> resolveSemiTypeOfExpression(JsParserResult parserResult, Node expression) {
   27.87 +    public static Collection<TypeUsage> resolveSemiTypeOfExpression(ModelBuilder builder, Node expression) {
   27.88          Collection<TypeUsage> result = new HashSet<TypeUsage>();
   27.89          SemiTypeResolverVisitor visitor = new SemiTypeResolverVisitor();
   27.90          if (expression != null) {
   27.91              result = visitor.getSemiTypes(expression);
   27.92          }
   27.93 +        if (builder.getCurrentWith()!= null) {
   27.94 +            Collection<TypeUsage> withResult = new HashSet<TypeUsage>();
   27.95 +            String withSemi = SemiTypeResolverVisitor.ST_WITH + builder.getCurrentWith().getFullyQualifiedName();
   27.96 +            
   27.97 +            for(TypeUsage type : result) {
   27.98 +                if (!KNOWN_TYPES.contains(type.getType())) {
   27.99 +                    withResult.add(new TypeUsageImpl(withSemi + type.getType(), type.getOffset(), type.isResolved()));
  27.100 +                } else {
  27.101 +                    withResult.add(type);
  27.102 +                }
  27.103 +            }
  27.104 +            result = withResult;
  27.105 +        }
  27.106          return result;
  27.107      }
  27.108      
  27.109 @@ -630,7 +656,6 @@
  27.110          List<JsObject> lastResolvedObjects = new ArrayList<JsObject>();
  27.111          List<TypeUsage> lastResolvedTypes = new ArrayList<TypeUsage>();
  27.112          
  27.113 -        
  27.114              for (int i = exp.size() - 1; i > -1; i--) {
  27.115                  String kind = exp.get(i);
  27.116                  String name = exp.get(--i);
  27.117 @@ -656,6 +681,25 @@
  27.118                      // find possible variables from local context, index contains only 
  27.119                      // public definition, we are interested in the private here as well
  27.120                      int index = name.lastIndexOf('.');
  27.121 +                    // needs to look, whether the expression is in a with statement
  27.122 +                    Collection<? extends TypeUsage> typeFromWith = getTypeFromWith(model, offset);
  27.123 +                    if (!typeFromWith.isEmpty()) {
  27.124 +                        String firstNamePart = index == -1 ? name : name.substring(0, index);
  27.125 +                        for (TypeUsage type : typeFromWith) {
  27.126 +                            //Collection<TypeUsage> resolveTypeFromSemiType = ModelUtils.resolveTypeFromSemiType(model.getGlobalObject(), type);
  27.127 +                            String sType = type.getType();
  27.128 +//                            if (sType.startsWith("@exp;")) {
  27.129 +//                                sType = sType.substring(5);
  27.130 +//                                sType = sType.replace("@pro;", ".");
  27.131 +//                            }
  27.132 +                            localObject = ModelUtils.findJsObjectByName(model, sType);
  27.133 +                            if (localObject != null && localObject.getProperty(firstNamePart) != null) {
  27.134 +                                name = localObject.getFullyQualifiedName() + "." + name;
  27.135 +                                break;
  27.136 +                            }
  27.137 +                        }
  27.138 +                    }
  27.139 +                    
  27.140                      if (index > -1) { // the first part is a fqn
  27.141                          localObject = ModelUtils.findJsObjectByName(model, name);
  27.142                          if (localObject != null) {
  27.143 @@ -713,6 +757,22 @@
  27.144                          } 
  27.145  //                        }
  27.146                          lastResolvedTypes.addAll(fromAssignments);
  27.147 +                        if (!typeFromWith.isEmpty()) {
  27.148 +//                            Collection<TypeUsage> resolveTypes = ModelUtils.resolveTypes(typeFromWith, parserRestult);
  27.149 +                            
  27.150 +                            for (TypeUsage typeUsage : typeFromWith) {
  27.151 +                                String sType = typeUsage.getType();
  27.152 +                            if (sType.startsWith("@exp;")) {
  27.153 +                                sType = sType.substring(5);
  27.154 +                                sType = sType.replace("@pro;", ".");
  27.155 +                            }   
  27.156 +                                ModelUtils.resolveAssignments(model, jsIndex, sType, fromAssignments);
  27.157 +                                for (TypeUsage typeUsage1 : fromAssignments) {
  27.158 +                                    lastResolvedTypes.add(new TypeUsageImpl(typeUsage1.getType() + kind + ";" + name, typeUsage.getOffset(), false));
  27.159 +                                }
  27.160 +                                
  27.161 +                            }
  27.162 +                        }
  27.163                      }
  27.164                      
  27.165                      if(!localObjects.isEmpty()){
  27.166 @@ -883,9 +943,9 @@
  27.167      public static List<String> expressionFromType(TypeUsage type) {
  27.168          String sexp = type.getType();
  27.169          if ((sexp.startsWith("@exp;") || sexp.startsWith("@new;") || sexp.startsWith("@arr;")
  27.170 -                || sexp.startsWith("@call;")) && (sexp.length() > 5)) {
  27.171 +                || sexp.startsWith("@call;") || sexp.startsWith(SemiTypeResolverVisitor.ST_WITH)) && (sexp.length() > 5)) {
  27.172              
  27.173 -            int start = sexp.startsWith("@call;") || sexp.startsWith("@arr;") ? 1 : sexp.charAt(5) == '@' ? 6 : 5;
  27.174 +            int start = sexp.startsWith("@call;") || sexp.startsWith("@arr;") || sexp.startsWith(SemiTypeResolverVisitor.ST_WITH) ? 1 : sexp.charAt(5) == '@' ? 6 : 5;
  27.175              sexp = sexp.substring(start);
  27.176              List<String> nExp = new ArrayList<String>();
  27.177              String[] split = sexp.split("@");
  27.178 @@ -895,7 +955,9 @@
  27.179                      nExp.add("@arr");
  27.180                  } else if (split[i].startsWith("call;")) {
  27.181                      nExp.add("@mtd");
  27.182 -                } else {
  27.183 +                } else if (split[i].startsWith("with;")) {
  27.184 +                    nExp.add("@with");
  27.185 +                }else {
  27.186                      nExp.add("@pro");
  27.187                  }
  27.188              }
  27.189 @@ -948,15 +1010,33 @@
  27.190      private static void resolveAssignments(Model model, JsObject jsObject, int offset, List<JsObject> resolvedObjects, List<TypeUsage> resolvedTypes) {
  27.191          Collection<? extends Type> assignments = jsObject.getAssignmentForOffset(offset);
  27.192          for (Type typeName : assignments) {
  27.193 -            
  27.194 -            JsObject byOffset = findObjectForOffset(typeName.getType(), offset, model);
  27.195 -            if (byOffset != null) {
  27.196 -                if(!jsObject.getName().equals(byOffset.getName())) {
  27.197 -                    resolvedObjects.add(byOffset);
  27.198 -                    resolveAssignments(model, byOffset, offset, resolvedObjects, resolvedTypes);
  27.199 +            String type = typeName.getType();
  27.200 +            if (type.startsWith(SemiTypeResolverVisitor.ST_WITH)) {
  27.201 +                List<String> expression = expressionFromType((TypeUsage)typeName);
  27.202 +                Collection<? extends TypeUsage> typesFromWith = ModelUtils.getTypeFromWith(model, typeName.getOffset());
  27.203 +                expression.remove(expression.size() - 1);
  27.204 +                expression.remove(expression.size() - 1);
  27.205 +
  27.206 +                StringBuilder sb = new StringBuilder();
  27.207 +                for (int i = expression.size() - 1; i > 0; i--) {
  27.208 +                    sb.append(expression.get(i--));
  27.209 +                    sb.append(";");
  27.210 +                    sb.append(expression.get(i));
  27.211                  }
  27.212 +                for (TypeUsage typeWith: typesFromWith) {
  27.213 +                    resolvedTypes.add(new TypeUsageImpl(SemiTypeResolverVisitor.ST_EXP + typeWith.getType() + sb.toString(), typeName.getOffset(), false));
  27.214 +                }
  27.215 +                
  27.216              } else {
  27.217 -                resolvedTypes.add((TypeUsage)typeName);
  27.218 +                JsObject byOffset = findObjectForOffset(typeName.getType(), offset, model);
  27.219 +                if (byOffset != null) {
  27.220 +                    if(!jsObject.getName().equals(byOffset.getName())) {
  27.221 +                        resolvedObjects.add(byOffset);
  27.222 +                        resolveAssignments(model, byOffset, offset, resolvedObjects, resolvedTypes);
  27.223 +                    }
  27.224 +                } else {
  27.225 +                    resolvedTypes.add((TypeUsage)typeName);
  27.226 +                }
  27.227              }
  27.228          }
  27.229      }
  27.230 @@ -1067,6 +1147,33 @@
  27.231          return result;
  27.232      }
  27.233      
  27.234 +    /**
  27.235 +     * 
  27.236 +     * @param model
  27.237 +     * @param offset
  27.238 +     * @return types from with expressions. The collection has the order of items from most inner with to
  27.239 +     *      the outer with.
  27.240 +     */
  27.241 +    public static Collection <? extends TypeUsage> getTypeFromWith(Model model, int offset) {
  27.242 +        JsObject jsObject = ModelUtils.findJsObject(model, offset);
  27.243 +        while(jsObject != null && jsObject.getJSKind() != JsElement.Kind.WITH_OBJECT) {
  27.244 +            jsObject = jsObject.getParent();
  27.245 +        }
  27.246 +        if (jsObject != null && jsObject.getJSKind() == JsElement.Kind.WITH_OBJECT) {
  27.247 +            List<TypeUsage> types = new ArrayList<TypeUsage>();
  27.248 +            JsWith wObject = (JsWith)jsObject;
  27.249 +            Collection<? extends TypeUsage> withTypes = wObject.getTypes();
  27.250 +            types.addAll(withTypes);
  27.251 +            while (wObject.getOuterWith() != null) {
  27.252 +                wObject = wObject.getOuterWith();
  27.253 +                withTypes = wObject.getTypes();
  27.254 +                types.addAll(withTypes);
  27.255 +            }
  27.256 +            return types;
  27.257 +        }
  27.258 +        return Collections.EMPTY_LIST;
  27.259 +    }
  27.260 +    
  27.261      public static void addUniqueType(Collection <TypeUsage> where, Set<String> forbidden, TypeUsage type) {
  27.262          String typeName = type.getType();
  27.263          if (forbidden.contains(typeName)) {
  27.264 @@ -1168,4 +1275,130 @@
  27.265      public static boolean isKnownGLobalType(String type) {
  27.266          return knownGlobalObjects.contains(type);
  27.267      }
  27.268 +    
  27.269 +    /**
  27.270 +     * 
  27.271 +     * @param snapshot
  27.272 +     * @param offset offset where the expression should be resolved
  27.273 +     * @param lookBefore if yes, looks for the beginning of the expression before the offset,
  27.274 +     *                  if no, it can be in a middle of expression
  27.275 +     * @return 
  27.276 +     */
  27.277 +    public static List<String> resolveExpressionChain(Snapshot snapshot, int offset, boolean lookBefore) {
  27.278 +        TokenHierarchy<?> th = snapshot.getTokenHierarchy();
  27.279 +        TokenSequence<? extends JsTokenId> ts = LexUtilities.getJsTokenSequence(th, offset);
  27.280 +        if (ts == null) {
  27.281 +            return Collections.<String>emptyList();
  27.282 +        }
  27.283 +
  27.284 +        ts.move(offset);
  27.285 +        if (ts.movePrevious() && (ts.moveNext() || ((ts.offset() + ts.token().length()) == snapshot.getText().length()))) {
  27.286 +            if (!lookBefore && ts.token().id() != JsTokenId.OPERATOR_DOT) {
  27.287 +                ts.movePrevious();
  27.288 +            }
  27.289 +            Token<? extends JsTokenId> token = lookBefore ? LexUtilities.findPrevious(ts, Arrays.asList(JsTokenId.WHITESPACE, JsTokenId.BLOCK_COMMENT, JsTokenId.EOL)) : ts.token();
  27.290 +            int parenBalancer = 0;
  27.291 +            // 1 - method call, 0 - property, 2 - array
  27.292 +            int partType = 0;
  27.293 +            boolean wasLastDot = lookBefore;
  27.294 +            int offsetFirstRightParen = -1;
  27.295 +            List<String> exp = new ArrayList();
  27.296 +
  27.297 +            while (token.id() != JsTokenId.WHITESPACE && token.id() != JsTokenId.OPERATOR_SEMICOLON
  27.298 +                    && token.id() != JsTokenId.BRACKET_RIGHT_CURLY && token.id() != JsTokenId.BRACKET_LEFT_CURLY
  27.299 +                    && token.id() != JsTokenId.BRACKET_LEFT_PAREN
  27.300 +                    && token.id() != JsTokenId.BLOCK_COMMENT
  27.301 +                    && token.id() != JsTokenId.LINE_COMMENT
  27.302 +                    && token.id() != JsTokenId.OPERATOR_ASSIGNMENT
  27.303 +                    && token.id() != JsTokenId.OPERATOR_PLUS) {
  27.304 +
  27.305 +                if (token.id() != JsTokenId.EOL) {
  27.306 +                    if (token.id() != JsTokenId.OPERATOR_DOT) {
  27.307 +                        if (token.id() == JsTokenId.BRACKET_RIGHT_PAREN) {
  27.308 +                            parenBalancer++;
  27.309 +                            partType = 1;
  27.310 +                            if (offsetFirstRightParen == -1) {
  27.311 +                                offsetFirstRightParen = ts.offset();
  27.312 +                            }
  27.313 +                            while (parenBalancer > 0 && ts.movePrevious()) {
  27.314 +                                token = ts.token();
  27.315 +                                if (token.id() == JsTokenId.BRACKET_RIGHT_PAREN) {
  27.316 +                                    parenBalancer++;
  27.317 +                                } else {
  27.318 +                                    if (token.id() == JsTokenId.BRACKET_LEFT_PAREN) {
  27.319 +                                        parenBalancer--;
  27.320 +                                    }
  27.321 +                                }
  27.322 +                            }
  27.323 +                        } else if (token.id() == JsTokenId.BRACKET_RIGHT_BRACKET) {
  27.324 +                            parenBalancer++;
  27.325 +                            partType = 2;
  27.326 +                            while (parenBalancer > 0 && ts.movePrevious()) {
  27.327 +                                token = ts.token();
  27.328 +                                if (token.id() == JsTokenId.BRACKET_RIGHT_BRACKET) {
  27.329 +                                    parenBalancer++;
  27.330 +                                } else {
  27.331 +                                    if (token.id() == JsTokenId.BRACKET_LEFT_BRACKET) {
  27.332 +                                        parenBalancer--;
  27.333 +                                    }
  27.334 +                                }
  27.335 +                            }
  27.336 +                        } else if (parenBalancer == 0 && "operator".equals(token.id().primaryCategory())) { // NOI18N
  27.337 +                            return exp;
  27.338 +                        } else {
  27.339 +                            exp.add(token.text().toString());
  27.340 +                            switch (partType) {
  27.341 +                                case 0:
  27.342 +                                    exp.add("@pro");   // NOI18N
  27.343 +                                    break;
  27.344 +                                case 1:
  27.345 +                                    exp.add("@mtd");   // NOI18N
  27.346 +                                    offsetFirstRightParen = -1;
  27.347 +                                    break;
  27.348 +                                case 2:
  27.349 +                                    exp.add("@arr");    // NOI18N
  27.350 +                                    break;
  27.351 +                                default:
  27.352 +                                    break;
  27.353 +                            }
  27.354 +                            partType = 0;
  27.355 +                            wasLastDot = false;
  27.356 +                        }
  27.357 +                    } else {
  27.358 +                        wasLastDot = true;
  27.359 +                    }
  27.360 +                } else {
  27.361 +                    if (!wasLastDot && ts.movePrevious()) {
  27.362 +                        // check whether it's continuatino of previous line
  27.363 +                        token = LexUtilities.findPrevious(ts, Arrays.asList(JsTokenId.WHITESPACE, JsTokenId.BLOCK_COMMENT, JsTokenId.LINE_COMMENT));
  27.364 +                        if (token.id() != JsTokenId.OPERATOR_DOT) {
  27.365 +                            // the dot was not found => it's not continuation of expression
  27.366 +                            break;
  27.367 +                        }
  27.368 +                    }
  27.369 +                }
  27.370 +                if (!ts.movePrevious()) {
  27.371 +                    break;
  27.372 +                }
  27.373 +                token = ts.token();
  27.374 +            }
  27.375 +            if (token.id() == JsTokenId.WHITESPACE) {
  27.376 +                if (ts.movePrevious()) {
  27.377 +                    token = LexUtilities.findPrevious(ts, Arrays.asList(JsTokenId.WHITESPACE, JsTokenId.BLOCK_COMMENT, JsTokenId.EOL));
  27.378 +                    if (token.id() == JsTokenId.KEYWORD_NEW && !exp.isEmpty()) {
  27.379 +                        exp.remove(exp.size() - 1);
  27.380 +                        exp.add("@pro");    // NOI18N
  27.381 +                    } else if (!lookBefore && offsetFirstRightParen > -1) {
  27.382 +                        // in the case when the expression is like ( new Object()).someMethod
  27.383 +                        exp.addAll(resolveExpressionChain(snapshot, offsetFirstRightParen - 1, true));
  27.384 +                    }
  27.385 +                }
  27.386 +            } else if (exp.isEmpty() && !lookBefore && offsetFirstRightParen > -1) {
  27.387 +                // in the case when the expression is like ( new Object()).someMethod
  27.388 +                exp.addAll(resolveExpressionChain(snapshot, offsetFirstRightParen - 1, true));
  27.389 +            }
  27.390 +            return exp;
  27.391 +        }
  27.392 +        return Collections.<String>emptyList();
  27.393 +    }
  27.394  }
    28.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/ModelVisitor.java	Tue Aug 13 14:01:33 2013 +0200
    28.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/ModelVisitor.java	Tue Aug 13 14:38:34 2013 +0200
    28.3 @@ -89,7 +89,9 @@
    28.4  import org.netbeans.modules.javascript2.editor.model.JsFunction;
    28.5  import org.netbeans.modules.javascript2.editor.spi.model.FunctionArgument;
    28.6  import org.netbeans.modules.javascript2.editor.model.JsObject;
    28.7 +import org.netbeans.modules.javascript2.editor.model.JsWith;
    28.8  import org.netbeans.modules.javascript2.editor.model.Model;
    28.9 +import org.netbeans.modules.javascript2.editor.model.ModelFactory;
   28.10  import org.netbeans.modules.javascript2.editor.model.Occurrence;
   28.11  import org.netbeans.modules.javascript2.editor.model.Type;
   28.12  import org.netbeans.modules.javascript2.editor.model.TypeUsage;
   28.13 @@ -166,22 +168,32 @@
   28.14                  if (name != null) {
   28.15                      List<Identifier> fqname = new ArrayList<Identifier>();
   28.16                      fqname.add(name); 
   28.17 -                    Collection<? extends JsObject> variables = ModelUtils.getVariables(modelBuilder.getCurrentDeclarationFunction());
   28.18 -                    fromAN = null;
   28.19 -                    for(JsObject variable : variables) {
   28.20 +                    if (!(modelBuilder.getCurrentObject() instanceof JsWith)) {
   28.21 +                        Collection<? extends JsObject> variables = ModelUtils.getVariables(modelBuilder.getCurrentDeclarationFunction());
   28.22 +                        fromAN = null;
   28.23 +                        for(JsObject variable : variables) {
   28.24                          if (variable.getName().equals(name.getName()) && (variable.getModifiers().contains(Modifier.PRIVATE) || variable instanceof ParameterObject)) {
   28.25 -                            fromAN = (JsObjectImpl)variable;
   28.26 -                            break;
   28.27 +                                fromAN = (JsObjectImpl)variable;
   28.28 +                                break;
   28.29 +                            }
   28.30 +                        }
   28.31 +                        if (fromAN == null) {
   28.32 +                            JsObject global = modelBuilder.getGlobal();
   28.33 +                            fromAN = (JsObjectImpl)global.getProperty(name.getName());
   28.34 +                            if (fromAN == null) {
   28.35 +                                fromAN = new JsObjectImpl(global, name, name.getOffsetRange(), false, global.getMimeType(), global.getSourceLabel());
   28.36 +                                global.addProperty(name.getName(), fromAN);
   28.37 +                            }
   28.38 +                        } 
   28.39 +                    } else {
   28.40 +                        JsObject withObject = modelBuilder.getCurrentObject();
   28.41 +                        fromAN = (JsObjectImpl)withObject.getProperty(name.getName());
   28.42 +                        if (fromAN == null) {
   28.43 +                            fromAN = new JsObjectImpl(withObject, name, name.getOffsetRange(), false, parserResult.getSnapshot().getMimeType(), null);
   28.44 +                            withObject.addProperty(name.getName(), fromAN);
   28.45                          }
   28.46                      }
   28.47 -                    if (fromAN == null) {
   28.48 -                        JsObject global = modelBuilder.getGlobal();
   28.49 -                        fromAN = (JsObjectImpl)global.getProperty(name.getName());
   28.50 -                        if (fromAN == null) {
   28.51 -                            fromAN = new JsObjectImpl(global, name, name.getOffsetRange(), false, global.getMimeType(), global.getSourceLabel());
   28.52 -                            global.addProperty(name.getName(), fromAN);
   28.53 -                        }
   28.54 -                    }
   28.55 +                    
   28.56                      fromAN.addOccurrence(name.getOffsetRange());
   28.57                  }
   28.58              } else {
   28.59 @@ -307,7 +319,7 @@
   28.60                      }
   28.61                      Collection<TypeUsage> types; 
   28.62                      if (parameter == null) {
   28.63 -                        types =  ModelUtils.resolveSemiTypeOfExpression(parserResult, binaryNode.rhs());
   28.64 +                        types =  ModelUtils.resolveSemiTypeOfExpression(modelBuilder, binaryNode.rhs());
   28.65                          Collection<TypeUsage> correctedTypes = new ArrayList<TypeUsage>(types.size());
   28.66                          for (TypeUsage type : types) {
   28.67                              String typeName = type.getType();
   28.68 @@ -363,7 +375,7 @@
   28.69                  }
   28.70                  
   28.71                  if (lObject != null) {
   28.72 -                    Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(parserResult, binaryNode.rhs());
   28.73 +                    Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(modelBuilder, binaryNode.rhs());
   28.74                      if (lhs instanceof IndexNode && lObject instanceof JsArrayImpl) {
   28.75                          ((JsArrayImpl)lObject).addTypesInArray(types);
   28.76                      } else {
   28.77 @@ -408,14 +420,6 @@
   28.78      }
   28.79  
   28.80      @Override
   28.81 -    public Node leave(WithNode withNode) {
   28.82 -        Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(parserResult, withNode.getExpression());
   28.83 -        modelBuilder.getCurrentDeclarationScope().addWithTypes(
   28.84 -                new OffsetRange(withNode.getStart(), withNode.getFinish()), types);
   28.85 -        return super.leave(withNode);
   28.86 -    }
   28.87 -
   28.88 -    @Override
   28.89      public Node leave(CallNode callNode) {
   28.90          Collection<JsObjectImpl> functionArguments = functionArgumentStack.pop();
   28.91          if(callNode.getFunction() instanceof AccessNode) {
   28.92 @@ -816,7 +820,7 @@
   28.93                  if (cNode.getFunction() instanceof IdentNode && "Array".equals(((IdentNode)cNode.getFunction()).getName())) {
   28.94                      List<TypeUsage> itemTypes = new ArrayList<TypeUsage>();
   28.95                      for (Node node : cNode.getArgs()) {
   28.96 -                        itemTypes.addAll(ModelUtils.resolveSemiTypeOfExpression(parserResult, node));
   28.97 +                        itemTypes.addAll(ModelUtils.resolveSemiTypeOfExpression(modelBuilder, node));
   28.98                      }
   28.99                      EnumSet<Modifier> modifiers = parent.getJSKind() != JsElement.Kind.FILE ? EnumSet.of(Modifier.PRIVATE) : EnumSet.of(Modifier.PUBLIC);
  28.100                      JsArrayImpl result = new JsArrayImpl(parent, name, name.getOffsetRange(), true, modifiers, parserResult.getSnapshot().getMimeType(), null);
  28.101 @@ -913,9 +917,9 @@
  28.102              }
  28.103              if (array != null) {
  28.104                  int aOffset = fqName == null ? lastVisited.getStart() : fqName.get(fqName.size() - 1).getOffsetRange().getEnd();
  28.105 -                array.addAssignment(ModelUtils.resolveSemiTypeOfExpression(parserResult, lNode), aOffset);
  28.106 +                array.addAssignment(ModelUtils.resolveSemiTypeOfExpression(modelBuilder, lNode), aOffset);
  28.107                  for (Node item : aNode.getArray()) {
  28.108 -                    array.addTypesInArray(ModelUtils.resolveSemiTypeOfExpression(parserResult, item));
  28.109 +                    array.addTypesInArray(ModelUtils.resolveSemiTypeOfExpression(modelBuilder, item));
  28.110                  }
  28.111              }
  28.112          } 
  28.113 @@ -1112,7 +1116,7 @@
  28.114                          // in the testFiles/model/property02.js file
  28.115                          //return null;
  28.116                      } else {
  28.117 -                        Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(parserResult, value);
  28.118 +                        Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(modelBuilder, value);
  28.119                          if (!types.isEmpty()) {
  28.120                              property.addAssignment(types, name.getOffsetRange().getStart());
  28.121                          }
  28.122 @@ -1141,7 +1145,7 @@
  28.123      @Override
  28.124      public Node enter(ReturnNode returnNode) {
  28.125          Node expression = returnNode.getExpression();
  28.126 -        Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(parserResult, expression);
  28.127 +        Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(modelBuilder, expression);
  28.128          if (expression == null) {
  28.129              types.add(new TypeUsageImpl(Type.UNDEFINED, returnNode.getStart(), true));
  28.130          } else {
  28.131 @@ -1187,7 +1191,10 @@
  28.132              parent = canBeSingletonPattern(1) ? resolveThis(parent) : parent;
  28.133              if (parent instanceof CatchBlockImpl) {
  28.134                  parent = parent.getParent();
  28.135 -            } 
  28.136 +            }
  28.137 +            while (parent instanceof JsWith) {
  28.138 +                parent = parent.getParent();
  28.139 +            }
  28.140              JsObjectImpl variable = (JsObjectImpl)parent.getProperty(varNode.getName().getName());
  28.141              Identifier name = ModelElementFactory.create(parserResult, varNode.getName());
  28.142              if (name != null) {
  28.143 @@ -1232,11 +1239,14 @@
  28.144                  JsDocumentationHolder docHolder = parserResult.getDocumentationHolder();
  28.145                  variable.setDeprecated(docHolder.isDeprecated(varNode));
  28.146                  variable.setDocumentation(docHolder.getDocumentation(varNode));
  28.147 -                modelBuilder.setCurrentObject(variable);
  28.148                  if (varNode.getInit() instanceof IdentNode) {
  28.149                      addOccurrence((IdentNode)varNode.getInit(), variable.getName());
  28.150                  }
  28.151 -                Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(parserResult, varNode.getInit());
  28.152 +                modelBuilder.setCurrentObject(variable);
  28.153 +                Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(modelBuilder, varNode.getInit());
  28.154 +                if (modelBuilder.getCurrentWith() != null) {
  28.155 +                    ((JsWithObjectImpl)modelBuilder.getCurrentWith()).addObjectWithAssignment(variable);
  28.156 +                }
  28.157                  for (TypeUsage type : types) {
  28.158                      variable.addAssignment(type, varNode.getName().getFinish());
  28.159                  }
  28.160 @@ -1277,6 +1287,37 @@
  28.161          return super.leave(varNode);
  28.162      }
  28.163  
  28.164 +    @Override
  28.165 +    public Node enter(WithNode withNode) {
  28.166 +        JsObjectImpl currentObject = modelBuilder.getCurrentObject();
  28.167 +//        Collection<TypeUsage> originalTypes = ModelUtils.resolveSemiTypeOfExpression(parserResult, withNode.getExpression());
  28.168 +//        List<TypeUsage> types = new ArrayList(originalTypes);
  28.169 +//        if (currentObject instanceof JsWith) {
  28.170 +//            JsWith outerWith = (JsWith) currentObject;
  28.171 +//            for (TypeUsage type : outerWith.getTypes()) {
  28.172 +//                for (TypeUsage oType : originalTypes) {
  28.173 +//                    String typeName = type.getType();
  28.174 +//                    String alteredName = oType.getType();
  28.175 +//                    if (alteredName.startsWith("@var;")) {
  28.176 +//                        alteredName = alteredName.substring(5);
  28.177 +//                        alteredName = "@pro;" + alteredName;
  28.178 +//                    }
  28.179 +//                    typeName = typeName + alteredName;
  28.180 +//                    types.add(new TypeUsageImpl(typeName, oType.getOffset(), false));
  28.181 +//                }
  28.182 +//            }
  28.183 +//        }
  28.184 +        Collection<TypeUsage> types = ModelUtils.resolveSemiTypeOfExpression(modelBuilder, withNode.getExpression());
  28.185 +        JsWithObjectImpl withObject = new JsWithObjectImpl(currentObject, modelBuilder.getUnigueNameForWithObject(), types, new OffsetRange(withNode.getStart(), withNode.getFinish()), 
  28.186 +                        new OffsetRange(withNode.getExpression().getStart(), withNode.getExpression().getFinish()),parserResult.getSnapshot().getMimeType(), null);
  28.187 +        currentObject.addProperty(withObject.getName(), withObject);
  28.188 +//        withNode.getExpression().accept(this); // expression should be visted when the with object is the current object.
  28.189 +        modelBuilder.setCurrentObject(withObject);
  28.190 +        withNode.getBody().accept(this);
  28.191 +        modelBuilder.reset();
  28.192 +        return null;
  28.193 +    }
  28.194 +
  28.195  //--------------------------------End of visit methods--------------------------------------
  28.196  
  28.197      public Map<FunctionInterceptor, Collection<FunctionCall>> getCallsForProcessing() {
  28.198 @@ -1505,20 +1546,28 @@
  28.199          DeclarationScope scope = modelBuilder.getCurrentDeclarationScope();
  28.200          JsObject property = null;
  28.201          JsObject parameter = null;
  28.202 -        while (scope != null && property == null && parameter == null) {
  28.203 -            JsFunction function = (JsFunction)scope;
  28.204 -            property = function.getProperty(name);
  28.205 -            parameter = function.getParameter(name);
  28.206 -            scope = scope.getParentScope();
  28.207 -        }
  28.208 -        if(parameter != null) {
  28.209 -            if (property == null) {
  28.210 -                property = parameter;
  28.211 -            } else {
  28.212 -                if(property.getJSKind() != JsElement.Kind.VARIABLE) {
  28.213 +        JsObject parent = modelBuilder.getCurrentObject();
  28.214 +        if (!(parent instanceof JsWith || (parent.getParent() != null && parent.getParent() instanceof JsWith))) {
  28.215 +            while (scope != null && property == null && parameter == null) {
  28.216 +                JsFunction function = (JsFunction)scope;
  28.217 +                property = function.getProperty(name);
  28.218 +                parameter = function.getParameter(name);
  28.219 +                scope = scope.getParentScope();
  28.220 +            }
  28.221 +            if(parameter != null) {
  28.222 +                if (property == null) {
  28.223                      property = parameter;
  28.224 +                } else {
  28.225 +                    if(property.getJSKind() != JsElement.Kind.VARIABLE) {
  28.226 +                        property = parameter;
  28.227 +                    }
  28.228                  }
  28.229              }
  28.230 +        } else {
  28.231 +            if (!(parent instanceof JsWith) && (parent.getParent() != null && parent.getParent() instanceof JsWith)) {
  28.232 +                parent = parent.getParent();
  28.233 +            }
  28.234 +            property = parent.getProperty(name);
  28.235          }
  28.236  
  28.237          if (property != null) {
  28.238 @@ -1533,16 +1582,19 @@
  28.239              IdentifierImpl nameIden = ModelElementFactory.create(parserResult, name, range.getStart(), range.getEnd());
  28.240              if (nameIden != null) {
  28.241                  JsObjectImpl newObject;
  28.242 +                if (!(parent instanceof JsWith)) {
  28.243 +                        parent = modelBuilder.getGlobal();
  28.244 +                }
  28.245                  if (!isFunction) {
  28.246 -                    newObject = new JsObjectImpl(modelBuilder.getGlobal(), nameIden, nameIden.getOffsetRange(),
  28.247 +                    newObject = new JsObjectImpl(parent, nameIden, nameIden.getOffsetRange(),
  28.248                              leftSite, parserResult.getSnapshot().getMimeType(), null);
  28.249                  } else {
  28.250                      FileObject fo = parserResult.getSnapshot().getSource().getFileObject();
  28.251 -                    newObject = new JsFunctionImpl(fo, modelBuilder.getGlobal(), nameIden, Collections.EMPTY_LIST,
  28.252 +                    newObject = new JsFunctionImpl(fo, parent, nameIden, Collections.EMPTY_LIST,
  28.253                              parserResult.getSnapshot().getMimeType(), null);
  28.254                  }
  28.255                  newObject.addOccurrence(nameIden.getOffsetRange());
  28.256 -                modelBuilder.getGlobal().addProperty(nameIden.getName(), newObject);
  28.257 +                parent.addProperty(nameIden.getName(), newObject);
  28.258              }
  28.259          }
  28.260      }
    29.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/SemiTypeResolverVisitor.java	Tue Aug 13 14:01:33 2013 +0200
    29.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/model/impl/SemiTypeResolverVisitor.java	Tue Aug 13 14:38:34 2013 +0200
    29.3 @@ -83,6 +83,7 @@
    29.4      public static final String ST_NEW = "@new;"; //NOI18N
    29.5      public static final String ST_ARR = "@arr;"; //NOI18N
    29.6      public static final String ST_ANONYM = "@anonym;"; //NOI18N
    29.7 +    public static final String ST_WITH = "@with;"; //NOI18N
    29.8              
    29.9      private static final TypeUsage BOOLEAN_TYPE = new TypeUsageImpl(Type.BOOLEAN, -1, true);
   29.10      private static final TypeUsage STRING_TYPE = new TypeUsageImpl(Type.STRING, -1, true);
    30.1 --- a/javascript2.editor/src/org/netbeans/modules/javascript2/editor/spi/model/ModelElementFactory.java	Tue Aug 13 14:01:33 2013 +0200
    30.2 +++ b/javascript2.editor/src/org/netbeans/modules/javascript2/editor/spi/model/ModelElementFactory.java	Tue Aug 13 14:38:34 2013 +0200
    30.3 @@ -426,11 +426,6 @@
    30.4          }
    30.5  
    30.6          @Override
    30.7 -        public List<? extends TypeUsage> getWithTypesForOffset(int offset) {
    30.8 -            return delegate.getWithTypesForOffset(offset);
    30.9 -        }
   30.10 -
   30.11 -        @Override
   30.12          public Collection<? extends JsObject> getParameters() {
   30.13              return delegate.getParameters();
   30.14          }
    31.1 --- a/javascript2.editor/test/unit/data/testfiles/completion/with/with1.js.testWith1.completion	Tue Aug 13 14:01:33 2013 +0200
    31.2 +++ b/javascript2.editor/test/unit/data/testfiles/completion/with/with1.js.testWith1.completion	Tue Aug 13 14:38:34 2013 +0200
    31.3 @@ -15,46 +15,193 @@
    31.4  CONSTRUCTO RegExp(pattern: String): RegEx  [PUBLIC]   JS Platform
    31.5  CONSTRUCTO String(): String                [PUBLIC]   JS Platform
    31.6  CONSTRUCTO XMLHttpRequest(): XMLHttpReque  [PUBLIC]   JS Platform
    31.7 +CLASS      AbstractView                    [PUBLIC]   JS Platform
    31.8 +CLASS      Arguments                       [PUBLIC]   JS Platform
    31.9 +CLASS      Attr                            [PUBLIC]   JS Platform
   31.10 +CLASS      CDATASection                    [PUBLIC]   JS Platform
   31.11 +CLASS      CSS2Properties                  [PUBLIC]   JS Platform
   31.12 +CLASS      CSSCharsetRule                  [PUBLIC]   JS Platform
   31.13 +CLASS      CSSFontFaceRule                 [PUBLIC]   JS Platform
   31.14 +CLASS      CSSImportRule                   [PUBLIC]   JS Platform
   31.15 +CLASS      CSSMediaRule                    [PUBLIC]   JS Platform
   31.16 +CLASS      CSSPageRule                     [PUBLIC]   JS Platform
   31.17 +CLASS      CSSPrimitiveValue               [PUBLIC]   JS Platform
   31.18 +CLASS      CSSRule                         [PUBLIC]   JS Platform
   31.19 +CLASS      CSSRuleList                     [PUBLIC]   JS Platform
   31.20 +CLASS      CSSStyleDeclaration             [PUBLIC]   JS Platform
   31.21 +CLASS      CSSStyleRule                    [PUBLIC]   JS Platform
   31.22 +CLASS      CSSStyleSheet                   [PUBLIC]   JS Platform
   31.23 +CLASS      CSSUnknownRule                  [PUBLIC]   JS Platform
   31.24 +CLASS      CSSValue                        [PUBLIC]   JS Platform
   31.25 +CLASS      CSSValueList                    [PUBLIC]   JS Platform
   31.26 +CLASS      CharacterData                   [PUBLIC]   JS Platform
   31.27 +CLASS      Comment                         [PUBLIC]   JS Platform
   31.28 +CLASS      Console                         [PUBLIC]   JS Platform
   31.29 +CLASS      Counter                         [PUBLIC]   JS Platform
   31.30 +CLASS      Crypto                          [PUBLIC]   JS Platform
   31.31 +CLASS      DOMConfiguration                [PUBLIC]   JS Platform
   31.32 +CLASS      DOMError                        [PUBLIC]   JS Platform
   31.33 +CLASS      DOMErrorHandler                 [PUBLIC]   JS Platform
   31.34 +CLASS      DOMException                    [PUBLIC]   JS Platform
   31.35 +CLASS      DOMImplementation               [PUBLIC]   JS Platform
   31.36 +CLASS      DOMImplementationCSS            [PUBLIC]   JS Platform
   31.37 +CLASS      DOMImplementationList           [PUBLIC]   JS Platform
   31.38 +CLASS      DOMImplementationSource         [PUBLIC]   JS Platform
   31.39 +CLASS      DOMLocator                      [PUBLIC]   JS Platform
   31.40 +CLASS      DOMObject                       [PUBLIC]   JS Platform
   31.41 +CLASS      DOMString                       [PUBLIC]   JS Platform
   31.42 +CLASS      DOMStringList                   [PUBLIC]   JS Platform
   31.43 +CLASS      DOMTimeStamp                    [PUBLIC]   JS Platform
   31.44 +CLASS      DOMUserData                     [PUBLIC]   JS Platform
   31.45 +CLASS      Document                        [PUBLIC]   JS Platform
   31.46 +CLASS      DocumentCSS                     [PUBLIC]   JS Platform
   31.47 +CLASS      DocumentEvent                   [PUBLIC]   JS Platform
   31.48 +CLASS      DocumentFragment                [PUBLIC]   JS Platform
   31.49 +CLASS      DocumentRange                   [PUBLIC]   JS Platform
   31.50 +CLASS      DocumentStyle                   [PUBLIC]   JS Platform
   31.51 +CLASS      DocumentTraversal               [PUBLIC]   JS Platform
   31.52 +CLASS      DocumentType                    [PUBLIC]   JS Platform
   31.53 +CLASS      DocumentView                    [PUBLIC]   JS Platform
   31.54 +CLASS      Element                         [PUBLIC]   JS Platform
   31.55 +CLASS      ElementCSSInlineStyle           [PUBLIC]   JS Platform
   31.56 +CLASS      ElementTraversal                [PUBLIC]   JS Platform
   31.57 +CLASS      Entity                          [PUBLIC]   JS Platform
   31.58 +CLASS      EntityReference                 [PUBLIC]   JS Platform
   31.59 +CLASS      Event                           [PUBLIC]   JS Platform
   31.60 +CLASS      EventException                  [PUBLIC]   JS Platform
   31.61 +CLASS      EventListener                   [PUBLIC]   JS Platform
   31.62 +CLASS      EventTarget                     [PUBLIC]   JS Platform
   31.63 +CLASS      HTMLAnchorElement               [PUBLIC]   JS Platform
   31.64 +CLASS      HTMLAppletElement               [PUBLIC]   JS Platform
   31.65 +CLASS      HTMLAreaElement                 [PUBLIC]   JS Platform
   31.66 +CLASS      HTMLBRElement                   [PUBLIC]   JS Platform
   31.67 +CLASS      HTMLBaseElement                 [PUBLIC]   JS Platform
   31.68 +CLASS      HTMLBaseFontElement             [PUBLIC]   JS Platform
   31.69 +CLASS      HTMLBodyElement                 [PUBLIC]   JS Platform
   31.70 +CLASS      HTMLButtonElement               [PUBLIC]   JS Platform
   31.71 +CLASS      HTMLCollection                  [PUBLIC]   JS Platform
   31.72 +CLASS      HTMLDListElement                [PUBLIC]   JS Platform
   31.73 +CLASS      HTMLDirectoryElement            [PUBLIC]   JS Platform
   31.74 +CLASS      HTMLDivElement                  [PUBLIC]   JS Platform
   31.75 +CLASS      HTMLDocument                    [PUBLIC]   JS Platform
   31.76 +CLASS      HTMLElement                     [PUBLIC]   JS Platform
   31.77 +CLASS      HTMLFieldSetElement             [PUBLIC]   JS Platform
   31.78 +CLASS      HTMLFontElement                 [PUBLIC]   JS Platform
   31.79 +CLASS      HTMLFormElement                 [PUBLIC]   JS Platform
   31.80 +CLASS      HTMLFrameElement                [PUBLIC]   JS Platform
   31.81 +CLASS      HTMLFrameSetElement             [PUBLIC]   JS Platform
   31.82 +CLASS      HTMLHRElement                   [PUBLIC]   JS Platform
   31.83 +CLASS      HTMLHeadElement                 [PUBLIC]   JS Platform
   31.84 +CLASS      HTMLHeadingElement              [PUBLIC]   JS Platform
   31.85 +CLASS      HTMLHtmlElement                 [PUBLIC]   JS Platform
   31.86 +CLASS      HTMLIFrameElement               [PUBLIC]   JS Platform
   31.87 +CLASS      HTMLImageElement                [PUBLIC]   JS Platform
   31.88 +CLASS      HTMLInputElement                [PUBLIC]   JS Platform
   31.89 +CLASS      HTMLIsIndexElement              [PUBLIC]   JS Platform
   31.90 +CLASS      HTMLLIElement                   [PUBLIC]   JS Platform
   31.91 +CLASS      HTMLLabelElement                [PUBLIC]   JS Platform
   31.92 +CLASS      HTMLLegendElement               [PUBLIC]   JS Platform
   31.93 +CLASS      HTMLLinkElement                 [PUBLIC]   JS Platform
   31.94 +CLASS      HTMLMapElement                  [PUBLIC]   JS Platform
   31.95 +CLASS      HTMLMenuElement                 [PUBLIC]   JS Platform
   31.96 +CLASS      HTMLMetaElement                 [PUBLIC]   JS Platform
   31.97 +CLASS      HTMLModElement                  [PUBLIC]   JS Platform
   31.98 +CLASS      HTMLOListElement                [PUBLIC]   JS Platform
   31.99 +CLASS      HTMLObjectElement               [PUBLIC]   JS Platform
  31.100 +CLASS      HTMLOptGroupElement             [PUBLIC]   JS Platform
  31.101 +CLASS      HTMLOptionElement               [PUBLIC]   JS Platform
  31.102 +CLASS      HTMLOptionsCollection           [PUBLIC]   JS Platform
  31.103 +CLASS      HTMLParagraphElement            [PUBLIC]   JS Platform
  31.104 +CLASS      HTMLParamElement                [PUBLIC]   JS Platform
  31.105 +CLASS      HTMLPreElement                  [PUBLIC]   JS Platform
  31.106 +CLASS      HTMLQuoteElement                [PUBLIC]   JS Platform
  31.107 +CLASS      HTMLScriptElement               [PUBLIC]   JS Platform
  31.108 +CLASS      HTMLSelectElement               [PUBLIC]   JS Platform
  31.109 +CLASS      HTMLStyleElement                [PUBLIC]   JS Platform
  31.110 +CLASS      HTMLTableCaptionElement         [PUBLIC]   JS Platform
  31.111 +CLASS      HTMLTableCellElement            [PUBLIC]   JS Platform
  31.112 +CLASS      HTMLTableColElement             [PUBLIC]   JS Platform
  31.113 +CLASS      HTMLTableElement                [PUBLIC]   JS Platform
  31.114 +CLASS      HTMLTableRowElement             [PUBLIC]   JS Platform
  31.115 +CLASS      HTMLTableSectionElement         [PUBLIC]   JS Platform
  31.116 +CLASS      HTMLTextAreaElement             [PUBLIC]   JS Platform
  31.117 +CLASS      HTMLTitleElement                [PUBLIC]   JS Platform
  31.118 +CLASS      HTMLUListElement                [PUBLIC]   JS Platform
  31.119 +CLASS      History                         [PUBLIC]   JS Platform
  31.120 +CLASS      InternalError                   [PUBLIC]   JS Platform
  31.121 +CLASS      Iterator                        [PUBLIC]   JS Platform
  31.122 +CLASS      JSON                            [PUBLIC]   JS Platform
  31.123 +CLASS      LinkStyle                       [PUBLIC]   JS Platform
  31.124 +CLASS      Location                        [PUBLIC]   JS Platform
  31.125 +CLASS      Math                            [PUBLIC]   JS Platform
  31.126 +CLASS      MediaList                       [PUBLIC]   JS Platform
  31.127 +CLASS      MouseEvent                      [PUBLIC]   JS Platform
  31.128 +CLASS      MutationEvent                   [PUBLIC]   JS Platform
  31.129 +CLASS      NameList                        [PUBLIC]   JS Platform
  31.130 +CLASS      NamedNodeMap                    [PUBLIC]   JS Platform
  31.131 +CLASS      Navigator                       [PUBLIC]   JS Platform
  31.132 +CLASS      Node                            [PUBLIC]   JS Platform
  31.133 +CLASS      NodeFilter                      [PUBLIC]   JS Platform
  31.134 +CLASS      NodeIterator                    [PUBLIC]   JS Platform
  31.135 +CLASS      NodeList                        [PUBLIC]   JS Platform
  31.136 +CLASS      Notation                        [PUBLIC]   JS Platform
  31.137 +CLASS      ProcessingInstruction           [PUBLIC]   JS Platform
  31.138 +CLASS      RGBColor                        [PUBLIC]   JS Platform
  31.139 +CLASS      Range                           [PUBLIC]   JS Platform
  31.140 +CLASS      RangeException                  [PUBLIC]   JS Platform
  31.141 +CLASS      Rect                            [PUBLIC]   JS Platform
  31.142 +CLASS      Screen                          [PUBLIC]   JS Platform
  31.143 +CLASS      StopIteration                   [PUBLIC]   JS Platform
  31.144 +CLASS      Storage                         [PUBLIC]   JS Platform
  31.145 +CLASS      StyleSheet                      [PUBLIC]   JS Platform
  31.146 +CLASS      StyleSheetList                  [PUBLIC]   JS Platform
  31.147 +CLASS      Text                            [PUBLIC]   JS Platform
  31.148 +CLASS      TreeWalker                      [PUBLIC]   JS Platform
  31.149 +CLASS      TypeInfo                        [PUBLIC]   JS Platform
  31.150 +CLASS      UIEvent                         [PUBLIC]   JS Platform
  31.151 +CLASS      UserDataHandler                 [PUBLIC]   JS Platform
  31.152 +CLASS      ViewCSS                         [PUBLIC]   JS Platform
  31.153 +CLASS      Window                          [PUBLIC]   JS Platform
  31.154  CLASS      b                               [PUBLIC]   with1.js
  31.155  CLASS      prototype                       [PUBLIC]   JS Platform
  31.156  CLASS      z                               [PUBLIC]   with1.js
  31.157 -METHOD     Image(width: Number, height: N  [PUBLIC]   JS Platform
  31.158 -METHOD     Option(text: String, value: St  [PUBLIC]   JS Platform
  31.159 +METHOD     Image(width: Number, height: N  [PUBLIC,   JS Platform
  31.160 +METHOD     Option(text: String, value: St  [PUBLIC,   JS Platform
  31.161  METHOD     SyntaxError(): Error            [PUBLIC]   JS Platform
  31.162  METHOD     TypeError(): Error              [PUBLIC]   JS Platform
  31.163  METHOD     URIError(): Error               [PUBLIC]   JS Platform
  31.164 -METHOD     Worker(uri: String): Worker     [PUBLIC]   JS Platform
  31.165 -METHOD     addEventListener(type: String,  [PUBLIC]   JS Platform
  31.166 -METHOD     alert(): undefined              [PUBLIC]   JS Platform
  31.167 -METHOD     atob(encodedData: String): Str  [PUBLIC]   JS Platform
  31.168 -METHOD     back(): undefined               [PUBLIC]   JS Platform
  31.169 -METHOD     blur(): undefined               [PUBLIC]   JS Platform
  31.170 -METHOD     btoa(stringToEncode: String):   [PUBLIC]   JS Platform
  31.171 -METHOD     clearImmediate(immediateID: Nu  [PUBLIC]   JS Platform
  31.172 -METHOD     clearInterval(intervalID: Numb  [PUBLIC]   JS Platform
  31.173 -METHOD     clearTimeout(timeoutID: Number  [PUBLIC]   JS Platform
  31.174 -METHOD     close(): undefined              [PUBLIC]   JS Platform
  31.175 -METHOD     confirm(message: String): Bool  [PUBLIC]   JS Platform
  31.176 +METHOD     Worker(uri: String): window.Wo  [PUBLIC,   JS Platform
  31.177 +METHOD     addEventListener(type: String,  [PUBLIC,   JS Platform
  31.178 +METHOD     alert(): undefined              [PUBLIC,   JS Platform
  31.179 +METHOD     atob(encodedData: String): Str  [PUBLIC,   JS Platform
  31.180 +METHOD     back(): undefined               [PUBLIC,   JS Platform
  31.181 +METHOD     blur(): undefined               [PUBLIC,   JS Platform
  31.182 +METHOD     btoa(stringToEncode: String):   [PUBLIC,   JS Platform
  31.183 +METHOD     clearImmediate(immediateID: Nu  [PUBLIC,   JS Platform
  31.184 +METHOD     clearInterval(intervalID: Numb  [PUBLIC,   JS Platform
  31.185 +METHOD     clearTimeout(timeoutID: Number  [PUBLIC,   JS Platform
  31.186 +METHOD     close(): undefined              [PUBLIC,   JS Platform
  31.187 +METHOD     confirm(message: String): Bool  [PUBLIC,   JS Platform
  31.188  METHOD     create(O: Object): Object       [PUBLIC,   JS Platform
  31.189  METHOD     decodeURI(encodedURI: String):  [PUBLIC]   JS Platform
  31.190  METHOD     decodeURIComponent(encodedURI:  [PUBLIC]   JS Platform
  31.191  METHOD     defineProperties(O: Object, Pr  [PUBLIC,   JS Platform
  31.192  METHOD     defineProperty(O: Object, P: S  [PUBLIC,   JS Platform
  31.193 -METHOD     dump(message: String): undefin  [PUBLIC]   JS Platform
  31.194 +METHOD     dump(message: String): undefin  [PUBLIC,   JS Platform
  31.195  METHOD     encodeURI(URI: String): String  [PUBLIC]   JS Platform
  31.196  METHOD     encodeURIComponent(str: String  [PUBLIC]   JS Platform
  31.197 -METHOD     escape(regular: String): Strin  [PUBLIC]   JS Platform
  31.198 +METHOD     escape(regular: String): Strin  [PUBLIC,   JS Platform
  31.199  METHOD     eval(string: String): Object    [PUBLIC]   JS Platform
  31.200 -METHOD     find(aString: String, aCaseSen  [PUBLIC]   JS Platform
  31.201 -METHOD     focus(): undefined              [PUBLIC]   JS Platform
  31.202 -METHOD     forward(): undefined            [PUBLIC]   JS Platform
  31.203 +METHOD     find(aString: String, aCaseSen  [PUBLIC,   JS Platform
  31.204 +METHOD     focus(): undefined              [PUBLIC,   JS Platform
  31.205 +METHOD     forward(): undefined            [PUBLIC,   JS Platform
  31.206  METHOD     freeze(O: Object): Object       [PUBLIC,   JS Platform
  31.207 -METHOD     getAttention(): undefined       [PUBLIC]   JS Platform
  31.208 -METHOD     getComputedStyle(element: Elem  [PUBLIC]   JS Platform
  31.209 +METHOD     getAttention(): undefined       [PUBLIC,   JS Platform
  31.210 +METHOD     getComputedStyle(element: Elem  [PUBLIC,   JS Platform
  31.211  METHOD     getOwnPropertyDescriptor(O: Ob  [PUBLIC,   JS Platform
  31.212  METHOD     getOwnPropertyNames(O: Object)  [PUBLIC,   JS Platform
  31.213  METHOD     getPrototypeOf(O: Object): Obj  [PUBLIC,   JS Platform
  31.214 -METHOD     getSelection(): Selection       [PUBLIC]   JS Platform
  31.215 +METHOD     getSelection(): Selection       [PUBLIC,   JS Platform
  31.216  METHOD     hasOwnProperty(V: String): Boo  [PUBLIC]   JS Platform
  31.217  METHOD     isExtensible(O: Object): Boole  [PUBLIC,   JS Platform
  31.218  METHOD     isFinite(number: Number): Bool  [PUBLIC]   JS Platform
  31.219 @@ -63,40 +210,41 @@
  31.220  METHOD     isPrototypeOf(V: Object): Bool  [PUBLIC]   JS Platform
  31.221  METHOD     isSealed(O: Object): Boolean    [PUBLIC,   JS Platform
  31.222  METHOD     keys(O: Object): Array          [PUBLIC,   JS Platform
  31.223 -METHOD     matchMedia(mediaQueryString: S  [PUBLIC]   JS Platform
  31.224 -METHOD     moveBy(deltaX: Number, deltaY:  [PUBLIC]   JS Platform
  31.225 -METHOD     moveTo(x: Number, y: Number):   [PUBLIC]   JS Platform
  31.226 -METHOD     open(strUrl: String, strWindow  [PUBLIC]   JS Platform
  31.227 -METHOD     openDialog(url: String, name:   [PUBLIC]   JS Platform
  31.228 +METHOD     matchMedia(mediaQueryString: S  [PUBLIC,   JS Platform
  31.229 +METHOD     moveBy(deltaX: Number, deltaY:  [PUBLIC,   JS Platform
  31.230 +METHOD     moveTo(x: Number, y: Number):   [PUBLIC,   JS Platform
  31.231 +METHOD     open(strUrl: String, strWindow  [PUBLIC,   JS Platform
  31.232 +METHOD     openDialog(url: String, name:   [PUBLIC,   JS Platform
  31.233  METHOD     parseFloat(string: String): Nu  [PUBLIC]   JS Platform
  31.234  METHOD     parseInt(string: String): Numb  [PUBLIC]   JS Platform
  31.235 -METHOD     postMessage(message: String, t  [PUBLIC]   JS Platform
  31.236 +METHOD     postMessage(message: String, t  [PUBLIC,   JS Platform
  31.237  METHOD     preventExtensions(O: Object):   [PUBLIC,   JS Platform
  31.238 -METHOD     print(): undefined              [PUBLIC]   JS Platform
  31.239 -METHOD     prompt(text: String, value: St  [PUBLIC]   JS Platform
  31.240 +METHOD     print(): undefined              [PUBLIC,   JS Platform
  31.241 +METHOD     prompt(text: String, value: St  [PUBLIC,   JS Platform
  31.242  METHOD     propertyIsEnumerable(V: String  [PUBLIC]   JS Platform
  31.243 -METHOD     removeEventListener(type: Stri  [PUBLIC]   JS Platform
  31.244 -METHOD     resizeBy(xDelta: Number, yDelt  [PUBLIC]   JS Platform
  31.245 -METHOD     resizeTo(iWidth: Number, iHeig  [PUBLIC]   JS Platform
  31.246 -METHOD     scroll(xcoord: Number, ycoord:  [PUBLIC]   JS Platform
  31.247 -METHOD     scrollBy(X: Number, Y: Number)  [PUBLIC]   JS Platform
  31.248 -METHOD     scrollByLines(lines: Number):   [PUBLIC]   JS Platform
  31.249 -METHOD     scrollByPages(pages: Number):   [PUBLIC]   JS Platform
  31.250 -METHOD     scrollTo(xcoord: Number, ycoor  [PUBLIC]   JS Platform
  31.251 +METHOD     removeEventListener(type: Stri  [PUBLIC,   JS Platform
  31.252 +METHOD     resizeBy(xDelta: Number, yDelt  [PUBLIC,   JS Platform
  31.253 +METHOD     resizeTo(iWidth: Number, iHeig  [PUBLIC,   JS Platform
  31.254 +METHOD     scroll(xcoord: Number, ycoord:  [PUBLIC,   JS Platform
  31.255 +METHOD     scrollBy(X: Number, Y: Number)  [PUBLIC,   JS Platform
  31.256 +METHOD     scrollByLines(lines: Number):   [PUBLIC,   JS Platform
  31.257 +METHOD     scrollByPages(pages: Number):   [PUBLIC,   JS Platform
  31.258 +METHOD     scrollTo(xcoord: Number, ycoor  [PUBLIC,   JS Platform
  31.259  METHOD     seal(O: Object): Object         [PUBLIC,   JS Platform
  31.260 -METHOD     setCursor(): undefined          [PUBLIC]   JS Platform
  31.261 -METHOD     setImmediate(func: Function):   [PUBLIC]   JS Platform
  31.262 -METHOD     setInterval(func: Function, de  [PUBLIC]   JS Platform
  31.263 -METHOD     setTimeout(func: Function, del  [PUBLIC]   JS Platform
  31.264 -METHOD     showModalDialog(uri: String):   [PUBLIC]   JS Platform
  31.265 -METHOD     sizeToContent(): undefined      [PUBLIC]   JS Platform
  31.266 -METHOD     stop(): undefined               [PUBLIC]   JS Platform
  31.267 +METHOD     setCursor(): undefined          [PUBLIC,   JS Platform
  31.268 +METHOD     setImmediate(func: Function):   [PUBLIC,   JS Platform
  31.269 +METHOD     setInterval(func: Function, de  [PUBLIC,   JS Platform
  31.270 +METHOD     setTimeout(func: Function, del  [PUBLIC,   JS Platform
  31.271 +METHOD     showModalDialog(uri: String):   [PUBLIC,   JS Platform
  31.272 +METHOD     sizeToContent(): undefined      [PUBLIC,   JS Platform
  31.273 +METHOD     stop(): undefined               [PUBLIC,   JS Platform
  31.274  METHOD     toLocaleString(): String        [PUBLIC]   JS Platform
  31.275  METHOD     toString(): String              [PUBLIC]   JS Platform
  31.276 -METHOD     unescape(escaped: String): Str  [PUBLIC]   JS Platform
  31.277 -METHOD     updateCommands(sCommandName):   [PUBLIC]   JS Platform
  31.278 +METHOD     unescape(escaped: String): Str  [PUBLIC,   JS Platform
  31.279 +METHOD     uneval(): Number                [PUBLIC]   JS Platform
  31.280 +METHOD     updateCommands(sCommandName):   [PUBLIC,   JS Platform
  31.281  METHOD     valueOf(): Object               [PUBLIC]   JS Platform
  31.282 -FIELD      Components: window.Components   [PUBLIC]   JS Platform
  31.283 +FIELD      Components: Components          [PUBLIC]   JS Platform
  31.284  FIELD      applicationCache: Object        [PUBLIC]   JS Platform
  31.285  FIELD      closed: Boolean                 [PUBLIC]   JS Platform
  31.286  FIELD      console: Console                [PUBLIC]   JS Platform
  31.287 @@ -106,7 +254,7 @@
  31.288  FIELD      crypto: Crypto                  [PUBLIC]   JS Platform
  31.289  FIELD      defaultStatus: String           [PUBLIC]   JS Platform
  31.290  FIELD      dialogArguments: Object         [PUBLIC]   JS Platform
  31.291 -FIELD      document: window.document       [PUBLIC]   JS Platform
  31.292 +FIELD      document: document              [PUBLIC]   JS Platform
  31.293  FIELD      frameElement: Element           [PUBLIC]   JS Platform
  31.294  FIELD      frames: Array                   [PUBLIC]   JS Platform
  31.295  FIELD      fullScreen: Boolean             [PUBLIC]   JS Platform
  31.296 @@ -174,154 +322,10 @@
  31.297  FIELD      window: Window                  [PUBLIC]   JS Platform
  31.298  FIELD      x: String                       [PUBLIC]   with1.js
  31.299  FIELD      y: Number                       [PUBLIC]   with1.js
  31.300 -VARIABLE   AbstractView                    [PUBLIC]   JS Platform
  31.301 -VARIABLE   Attr                            [PUBLIC]   JS Platform
  31.302 -VARIABLE   CDATASection                    [PUBLIC]   JS Platform
  31.303 -VARIABLE   CSS2Properties                  [PUBLIC]   JS Platform
  31.304 -VARIABLE   CSSCharsetRule                  [PUBLIC]   JS Platform
  31.305 -VARIABLE   CSSFontFaceRule                 [PUBLIC]   JS Platform
  31.306 -VARIABLE   CSSImportRule                   [PUBLIC]   JS Platform
  31.307 -VARIABLE   CSSMediaRule                    [PUBLIC]   JS Platform
  31.308 -VARIABLE   CSSPageRule                     [PUBLIC]   JS Platform
  31.309 -VARIABLE   CSSPrimitiveValue               [PUBLIC]   JS Platform
  31.310 -VARIABLE   CSSRule                         [PUBLIC]   JS Platform
  31.311 -VARIABLE   CSSRuleList                     [PUBLIC]   JS Platform
  31.312 -VARIABLE   CSSStyleDeclaration             [PUBLIC]   JS Platform
  31.313 -VARIABLE   CSSStyleRule                    [PUBLIC]   JS Platform
  31.314 -VARIABLE   CSSStyleSheet                   [PUBLIC]   JS Platform
  31.315 -VARIABLE   CSSUnknownRule                  [PUBLIC]   JS Platform
  31.316 -VARIABLE   CSSValue                        [PUBLIC]   JS Platform
  31.317 -VARIABLE   CSSValueList                    [PUBLIC]   JS Platform
  31.318 -VARIABLE   CharacterData                   [PUBLIC]   JS Platform
  31.319 -VARIABLE   Comment                         [PUBLIC]   JS Platform
  31.320 -VARIABLE   Console                         [PUBLIC]   JS Platform
  31.321 -VARIABLE   Counter                         [PUBLIC]   JS Platform
  31.322 -VARIABLE   Crypto                          [PUBLIC]   JS Platform
  31.323 -VARIABLE   DOMConfiguration                [PUBLIC]   JS Platform
  31.324 -VARIABLE   DOMError                        [PUBLIC]   JS Platform
  31.325 -VARIABLE   DOMErrorHandler                 [PUBLIC]   JS Platform
  31.326 -VARIABLE   DOMException                    [PUBLIC]   JS Platform
  31.327 -VARIABLE   DOMImplementation               [PUBLIC]   JS Platform
  31.328 -VARIABLE   DOMImplementationCSS            [PUBLIC]   JS Platform
  31.329 -VARIABLE   DOMImplementationList           [PUBLIC]   JS Platform
  31.330 -VARIABLE   DOMImplementationSource         [PUBLIC]   JS Platform
  31.331 -VARIABLE   DOMLocator                      [PUBLIC]   JS Platform
  31.332 -VARIABLE   DOMObject                       [PUBLIC]   JS Platform
  31.333 -VARIABLE   DOMString                       [PUBLIC]   JS Platform
  31.334 -VARIABLE   DOMStringList                   [PUBLIC]   JS Platform
  31.335 -VARIABLE   DOMTimeStamp                    [PUBLIC]   JS Platform
  31.336 -VARIABLE   DOMUserData                     [PUBLIC]   JS Platform
  31.337 -VARIABLE   Document: Node                  [PUBLIC]   JS Platform
  31.338 -VARIABLE   DocumentCSS                     [PUBLIC]   JS Platform
  31.339 -VARIABLE   DocumentEvent                   [PUBLIC]   JS Platform
  31.340 -VARIABLE   DocumentFragment                [PUBLIC]   JS Platform
  31.341 -VARIABLE   DocumentRange                   [PUBLIC]   JS Platform
  31.342 -VARIABLE   DocumentStyle                   [PUBLIC]   JS Platform
  31.343 -VARIABLE   DocumentTraversal               [PUBLIC]   JS Platform
  31.344 -VARIABLE   DocumentType                    [PUBLIC]   JS Platform
  31.345 -VARIABLE   DocumentView                    [PUBLIC]   JS Platform
  31.346 -VARIABLE   Element: Node                   [PUBLIC]   JS Platform
  31.347 -VARIABLE   ElementCSSInlineStyle           [PUBLIC]   JS Platform
  31.348 -VARIABLE   ElementTraversal                [PUBLIC]   JS Platform
  31.349 -VARIABLE   Entity                          [PUBLIC]   JS Platform
  31.350 -VARIABLE   EntityReference                 [PUBLIC]   JS Platform
  31.351 -VARIABLE   Event                           [PUBLIC]   JS Platform
  31.352 -VARIABLE   EventException                  [PUBLIC]   JS Platform
  31.353 -VARIABLE   EventListener                   [PUBLIC]   JS Platform
  31.354 -VARIABLE   EventTarget                     [PUBLIC]   JS Platform
  31.355 -VARIABLE   HTMLAnchorElement               [PUBLIC]   JS Platform
  31.356 -VARIABLE   HTMLAppletElement               [PUBLIC]   JS Platform
  31.357 -VARIABLE   HTMLAreaElement                 [PUBLIC]   JS Platform
  31.358 -VARIABLE   HTMLBRElement                   [PUBLIC]   JS Platform
  31.359 -VARIABLE   HTMLBaseElement                 [PUBLIC]   JS Platform
  31.360 -VARIABLE   HTMLBaseFontElement             [PUBLIC]   JS Platform
  31.361 -VARIABLE   HTMLBodyElement                 [PUBLIC]   JS Platform
  31.362 -VARIABLE   HTMLButtonElement               [PUBLIC]   JS Platform
  31.363 -VARIABLE   HTMLCollection                  [PUBLIC]   JS Platform
  31.364 -VARIABLE   HTMLDListElement                [PUBLIC]   JS Platform
  31.365 -VARIABLE   HTMLDirectoryElement            [PUBLIC]   JS Platform
  31.366 -VARIABLE   HTMLDivElement                  [PUBLIC]   JS Platform
  31.367 -VARIABLE   HTMLDocument: Document          [PUBLIC]   JS Platform
  31.368 -VARIABLE   HTMLElement: Element            [PUBLIC]   JS Platform
  31.369 -VARIABLE   HTMLFieldSetElement             [PUBLIC]   JS Platform
  31.370 -VARIABLE   HTMLFontElement                 [PUBLIC]   JS Platform
  31.371 -VARIABLE   HTMLFormElement                 [PUBLIC]   JS Platform
  31.372 -VARIABLE   HTMLFrameElement                [PUBLIC]   JS Platform
  31.373 -VARIABLE   HTMLFrameSetElement             [PUBLIC]   JS Platform
  31.374 -VARIABLE   HTMLHRElement                   [PUBLIC]   JS Platform
  31.375 -VARIABLE   HTMLHeadElement                 [PUBLIC]   JS Platform
  31.376 -VARIABLE   HTMLHeadingElement              [PUBLIC]   JS Platform
  31.377 -VARIABLE   HTMLHtmlElement                 [PUBLIC]   JS Platform
  31.378 -VARIABLE   HTMLIFrameElement               [PUBLIC]   JS Platform
  31.379 -VARIABLE   HTMLImageElement                [PUBLIC]   JS Platform
  31.380 -VARIABLE   HTMLInputElement                [PUBLIC]   JS Platform
  31.381 -VARIABLE   HTMLIsIndexElement              [PUBLIC]   JS Platform
  31.382 -VARIABLE   HTMLLIElement                   [PUBLIC]   JS Platform
  31.383 -VARIABLE   HTMLLabelElement                [PUBLIC]   JS Platform
  31.384 -VARIABLE   HTMLLegendElement               [PUBLIC]   JS Platform
  31.385 -VARIABLE   HTMLLinkElement                 [PUBLIC]   JS Platform
  31.386 -VARIABLE   HTMLMapElement                  [PUBLIC]   JS Platform
  31.387 -VARIABLE   HTMLMenuElement                 [PUBLIC]   JS Platform
  31.388 -VARIABLE   HTMLMetaElement                 [PUBLIC]   JS Platform
  31.389 -VARIABLE   HTMLModElement                  [PUBLIC]   JS Platform
  31.390 -VARIABLE   HTMLOListElement                [PUBLIC]   JS Platform
  31.391 -VARIABLE   HTMLObjectElement               [PUBLIC]   JS Platform
  31.392 -VARIABLE   HTMLOptGroupElement             [PUBLIC]   JS Platform
  31.393 -VARIABLE   HTMLOptionElement               [PUBLIC]   JS Platform
  31.394 -VARIABLE   HTMLOptionsCollection           [PUBLIC]   JS Platform
  31.395 -VARIABLE   HTMLParagraphElement            [PUBLIC]   JS Platform
  31.396 -VARIABLE   HTMLParamElement                [PUBLIC]   JS Platform
  31.397 -VARIABLE   HTMLPreElement                  [PUBLIC]   JS Platform
  31.398 -VARIABLE   HTMLQuoteElement                [PUBLIC]   JS Platform
  31.399 -VARIABLE   HTMLScriptElement               [PUBLIC]   JS Platform
  31.400 -VARIABLE   HTMLSelectElement               [PUBLIC]   JS Platform
  31.401 -VARIABLE   HTMLStyleElement                [PUBLIC]   JS Platform
  31.402 -VARIABLE   HTMLTableCaptionElement         [PUBLIC]   JS Platform
  31.403 -VARIABLE   HTMLTableCellElement            [PUBLIC]   JS Platform
  31.404 -VARIABLE   HTMLTableColElement             [PUBLIC]   JS Platform
  31.405 -VARIABLE   HTMLTableElement                [PUBLIC]   JS Platform
  31.406 -VARIABLE   HTMLTableRowElement             [PUBLIC]   JS Platform
  31.407 -VARIABLE   HTMLTableSectionElement         [PUBLIC]   JS Platform
  31.408 -VARIABLE   HTMLTextAreaElement             [PUBLIC]   JS Platform
  31.409 -VARIABLE   HTMLTitleElement                [PUBLIC]   JS Platform
  31.410 -VARIABLE   HTMLUListElement                [PUBLIC]   JS Platform
  31.411 -VARIABLE   History                         [PUBLIC]   JS Platform
  31.412  VARIABLE   Infinity: Number                [PUBLIC]   JS Platform
  31.413 -VARIABLE   JSON                            [PUBLIC]   JS Platform
  31.414 -VARIABLE   LinkStyle                       [PUBLIC]   JS Platform
  31.415 -VARIABLE   Location                        [PUBLIC]   JS Platform
  31.416 -VARIABLE   Math                            [PUBLIC]   JS Platform
  31.417 -VARIABLE   MediaList                       [PUBLIC]   JS Platform
  31.418 -VARIABLE   MouseEvent                      [PUBLIC]   JS Platform
  31.419 -VARIABLE   MutationEvent                   [PUBLIC]   JS Platform
  31.420  VARIABLE   NaN: Number                     [PUBLIC]   JS Platform
  31.421 -VARIABLE   NameList                        [PUBLIC]   JS Platform
  31.422 -VARIABLE   NamedNodeMap                    [PUBLIC]   JS Platform
  31.423 -VARIABLE   Navigator                       [PUBLIC]   JS Platform
  31.424 -VARIABLE   Node                            [PUBLIC]   JS Platform
  31.425 -VARIABLE   NodeFilter                      [PUBLIC]   JS Platform
  31.426 -VARIABLE   NodeIterator                    [PUBLIC]   JS Platform
  31.427 -VARIABLE   NodeList                        [PUBLIC]   JS Platform
  31.428 -VARIABLE   Notation                        [PUBLIC]   JS Platform
  31.429 -VARIABLE   ProcessingInstruction           [PUBLIC]   JS Platform
  31.430 -VARIABLE   RGBColor                        [PUBLIC]   JS Platform
  31.431 -VARIABLE   Range                           [PUBLIC]   JS Platform
  31.432 -VARIABLE   RangeException                  [PUBLIC]   JS Platform
  31.433 -VARIABLE   Rect                            [PUBLIC]   JS Platform
  31.434 -VARIABLE   Screen                          [PUBLIC]   JS Platform
  31.435 -VARIABLE   Storage                         [PUBLIC]   JS Platform
  31.436 -VARIABLE   StyleSheet                      [PUBLIC]   JS Platform
  31.437 -VARIABLE   StyleSheetList                  [PUBLIC]   JS Platform
  31.438 -VARIABLE   Text                            [PUBLIC]   JS Platform
  31.439 -VARIABLE   TreeWalker                      [PUBLIC]   JS Platform
  31.440 -VARIABLE   TypeInfo                        [PUBLIC]   JS Platform
  31.441 -VARIABLE   UIEvent                         [PUBLIC]   JS Platform
  31.442 -VARIABLE   UserDataHandler                 [PUBLIC]   JS Platform
  31.443 -VARIABLE   ViewCSS                         [PUBLIC]   JS Platform
  31.444 -VARIABLE   Window                          [PUBLIC]   JS Platform
  31.445 -VARIABLE   b                               [PUBLIC]   with2.js
  31.446 +VARIABLE   Proxy                           [PUBLIC]   JS Platform
  31.447  VARIABLE   undefined: undefined            [PUBLIC]   JS Platform
  31.448 -VARIABLE   z                               [PUBLIC]   with2.js
  31.449  KEYWORD    break                                      null
  31.450  KEYWORD    case                                       null
  31.451  KEYWORD    catch                                      null
    32.1 --- a/javascript2.editor/test/unit/data/testfiles/completion/with/with2.js.testWith2.completion	Tue Aug 13 14:01:33 2013 +0200
    32.2 +++ b/javascript2.editor/test/unit/data/testfiles/completion/with/with2.js.testWith2.completion	Tue Aug 13 14:38:34 2013 +0200
    32.3 @@ -4,12 +4,9 @@
    32.4  ------------------------------------
    32.5  CLASS      prototype                       [PUBLIC]   JS Platform
    32.6  METHOD     anchor(nameAttribute: String):  [PUBLIC]   JS Platform
    32.7 -METHOD     apply(thisArg: String, argArra  [PUBLIC]   JS Platform
    32.8  METHOD     big(): String                   [PUBLIC]   JS Platform
    32.9 -METHOD     bind(thisArg: Object): String   [PUBLIC]   JS Platform
   32.10  METHOD     blink(): String                 [PUBLIC]   JS Platform
   32.11  METHOD     bold(): String                  [PUBLIC]   JS Platform
   32.12 -METHOD     call(thisArg: Object): String   [PUBLIC]   JS Platform
   32.13  METHOD     charAt(pos: Number): String     [PUBLIC]   JS Platform
   32.14  METHOD     charCodeAt(pos: Number): Numbe  [PUBLIC]   JS Platform
   32.15  METHOD     concat(): String                [PUBLIC]   JS Platform
    33.1 --- a/javascript2.editor/test/unit/data/testfiles/completion/with/with3.js.testWith3.completion	Tue Aug 13 14:01:33 2013 +0200
    33.2 +++ b/javascript2.editor/test/unit/data/testfiles/completion/with/with3.js.testWith3.completion	Tue Aug 13 14:38:34 2013 +0200
    33.3 @@ -15,45 +15,193 @@
    33.4  CONSTRUCTO RegExp(pattern: String): RegEx  [PUBLIC]   JS Platform
    33.5  CONSTRUCTO String(): String                [PUBLIC]   JS Platform
    33.6  CONSTRUCTO XMLHttpRequest(): XMLHttpReque  [PUBLIC]   JS Platform
    33.7 +CLASS      AbstractView                    [PUBLIC]   JS Platform
    33.8 +CLASS      Arguments                       [PUBLIC]   JS Platform
    33.9 +CLASS      Attr                            [PUBLIC]   JS Platform
   33.10 +CLASS      CDATASection                    [PUBLIC]   JS Platform
   33.11 +CLASS      CSS2Properties                  [PUBLIC]   JS Platform
   33.12 +CLASS      CSSCharsetRule                  [PUBLIC]   JS Platform
   33.13 +CLASS      CSSFontFaceRule                 [PUBLIC]   JS Platform
   33.14 +CLASS      CSSImportRule                   [PUBLIC]   JS Platform
   33.15 +CLASS      CSSMediaRule                    [PUBLIC]   JS Platform
   33.16 +CLASS      CSSPageRule                     [PUBLIC]   JS Platform
   33.17 +CLASS      CSSPrimitiveValue               [PUBLIC]   JS Platform
   33.18 +CLASS      CSSRule                         [PUBLIC]   JS Platform
   33.19 +CLASS      CSSRuleList                     [PUBLIC]   JS Platform
   33.20 +CLASS      CSSStyleDeclaration             [PUBLIC]   JS Platform
   33.21 +CLASS      CSSStyleRule                    [PUBLIC]   JS Platform
   33.22 +CLASS      CSSStyleSheet                   [PUBLIC]   JS Platform
   33.23 +CLASS      CSSUnknownRule                  [PUBLIC]   JS Platform
   33.24 +CLASS      CSSValue                        [PUBLIC]   JS Platform
   33.25 +CLASS      CSSValueList                    [PUBLIC]   JS Platform
   33.26 +CLASS      CharacterData                   [PUBLIC]   JS Platform
   33.27 +CLASS      Comment                         [PUBLIC]   JS Platform
   33.28 +CLASS      Console                         [PUBLIC]   JS Platform
   33.29 +CLASS      Counter                         [PUBLIC]   JS Platform
   33.30 +CLASS      Crypto                          [PUBLIC]   JS Platform
   33.31 +CLASS      DOMConfiguration                [PUBLIC]   JS Platform
   33.32 +CLASS      DOMError                        [PUBLIC]   JS Platform
   33.33 +CLASS      DOMErrorHandler                 [PUBLIC]   JS Platform
   33.34 +CLASS      DOMException                    [PUBLIC]   JS Platform
   33.35 +CLASS      DOMImplementation               [PUBLIC]   JS Platform
   33.36 +CLASS      DOMImplementationCSS            [PUBLIC]   JS Platform
   33.37 +CLASS      DOMImplementationList           [PUBLIC]   JS Platform
   33.38 +CLASS      DOMImplementationSource         [PUBLIC]   JS Platform
   33.39 +CLASS      DOMLocator                      [PUBLIC]   JS Platform
   33.40 +CLASS      DOMObject                       [PUBLIC]   JS Platform
   33.41 +CLASS      DOMString                       [PUBLIC]   JS Platform
   33.42 +CLASS      DOMStringList                   [PUBLIC]   JS Platform
   33.43 +CLASS      DOMTimeStamp                    [PUBLIC]   JS Platform
   33.44 +CLASS      DOMUserData                     [PUBLIC]   JS Platform
   33.45 +CLASS      Document                        [PUBLIC]   JS Platform
   33.46 +CLASS      DocumentCSS                     [PUBLIC]   JS Platform
   33.47 +CLASS      DocumentEvent                   [PUBLIC]   JS Platform
   33.48 +CLASS      DocumentFragment                [PUBLIC]   JS Platform
   33.49 +CLASS      DocumentRange                   [PUBLIC]   JS Platform
   33.50 +CLASS      DocumentStyle                   [PUBLIC]   JS Platform
   33.51 +CLASS      DocumentTraversal               [PUBLIC]   JS Platform
   33.52 +CLASS      DocumentType                    [PUBLIC]   JS Platform
   33.53 +CLASS      DocumentView                    [PUBLIC]   JS Platform
   33.54 +CLASS      Element                         [PUBLIC]   JS Platform
   33.55 +CLASS      ElementCSSInlineStyle           [PUBLIC]   JS Platform
   33.56 +CLASS      ElementTraversal                [PUBLIC]   JS Platform
   33.57 +CLASS      Entity                          [PUBLIC]   JS Platform
   33.58 +CLASS      EntityReference                 [PUBLIC]   JS Platform
   33.59 +CLASS      Event                           [PUBLIC]   JS Platform
   33.60 +CLASS      EventException                  [PUBLIC]   JS Platform
   33.61 +CLASS      EventListener                   [PUBLIC]   JS Platform
   33.62 +CLASS      EventTarget                     [PUBLIC]   JS Platform
   33.63 +CLASS      HTMLAnchorElement               [PUBLIC]   JS Platform
   33.64 +CLASS      HTMLAppletElement               [PUBLIC]   JS Platform
   33.65 +CLASS      HTMLAreaElement                 [PUBLIC]   JS Platform
   33.66 +CLASS      HTMLBRElement                   [PUBLIC]   JS Platform
   33.67 +CLASS      HTMLBaseElement                 [PUBLIC]   JS Platform
   33.68 +CLASS      HTMLBaseFontElement             [PUBLIC]   JS Platform
   33.69 +CLASS      HTMLBodyElement                 [PUBLIC]   JS Platform
   33.70 +CLASS      HTMLButtonElement               [PUBLIC]   JS Platform
   33.71 +CLASS      HTMLCollection                  [PUBLIC]   JS Platform
   33.72 +CLASS      HTMLDListElement                [PUBLIC]   JS Platform
   33.73 +CLASS      HTMLDirectoryElement            [PUBLIC]   JS Platform
   33.74 +CLASS      HTMLDivElement                  [PUBLIC]   JS Platform
   33.75 +CLASS      HTMLDocument                    [PUBLIC]   JS Platform
   33.76 +CLASS      HTMLElement                     [PUBLIC]   JS Platform
   33.77 +CLASS      HTMLFieldSetElement             [PUBLIC]   JS Platform
   33.78 +CLASS      HTMLFontElement                 [PUBLIC]   JS Platform
   33.79 +CLASS      HTMLFormElement                 [PUBLIC]   JS Platform
   33.80 +CLASS      HTMLFrameElement                [PUBLIC]   JS Platform
   33.81 +CLASS      HTMLFrameSetElement             [PUBLIC]   JS Platform
   33.82 +CLASS      HTMLHRElement                   [PUBLIC]   JS Platform
   33.83 +CLASS      HTMLHeadElement                 [PUBLIC]   JS Platform
   33.84 +CLASS      HTMLHeadingElement              [PUBLIC]   JS Platform
   33.85 +CLASS      HTMLHtmlElement                 [PUBLIC]   JS Platform
   33.86 +CLASS      HTMLIFrameElement               [PUBLIC]   JS Platform
   33.87 +CLASS      HTMLImageElement                [PUBLIC]   JS Platform
   33.88 +CLASS      HTMLInputElement                [PUBLIC]   JS Platform
   33.89 +CLASS      HTMLIsIndexElement              [PUBLIC]   JS Platform
   33.90 +CLASS      HTMLLIElement                   [PUBLIC]   JS Platform
   33.91 +CLASS      HTMLLabelElement                [PUBLIC]   JS Platform
   33.92 +CLASS      HTMLLegendElement               [PUBLIC]   JS Platform
   33.93 +CLASS      HTMLLinkElement                 [PUBLIC]   JS Platform
   33.94 +CLASS      HTMLMapElement                  [PUBLIC]   JS Platform
   33.95 +CLASS      HTMLMenuElement                 [PUBLIC]   JS Platform
   33.96 +CLASS      HTMLMetaElement                 [PUBLIC]   JS Platform
   33.97 +CLASS      HTMLModElement                  [PUBLIC]   JS Platform
   33.98 +CLASS      HTMLOListElement                [PUBLIC]   JS Platform
   33.99 +CLASS      HTMLObjectElement               [PUBLIC]   JS Platform
  33.100 +CLASS      HTMLOptGroupElement             [PUBLIC]   JS Platform
  33.101 +CLASS      HTMLOptionElement               [PUBLIC]   JS Platform
  33.102 +CLASS      HTMLOptionsCollection           [PUBLIC]   JS Platform
  33.103 +CLASS      HTMLParagraphElement            [PUBLIC]   JS Platform
  33.104 +CLASS      HTMLParamElement                [PUBLIC]   JS Platform
  33.105 +CLASS      HTMLPreElement                  [PUBLIC]   JS Platform
  33.106 +CLASS      HTMLQuoteElement                [PUBLIC]   JS Platform
  33.107 +CLASS      HTMLScriptElement               [PUBLIC]   JS Platform
  33.108 +CLASS      HTMLSelectElement               [PUBLIC]   JS Platform
  33.109 +CLASS      HTMLStyleElement                [PUBLIC]   JS Platform
  33.110 +CLASS      HTMLTableCaptionElement         [PUBLIC]   JS Platform
  33.111 +CLASS      HTMLTableCellElement            [PUBLIC]   JS Platform
  33.112 +CLASS      HTMLTableColElement             [PUBLIC]   JS Platform
  33.113 +CLASS      HTMLTableElement                [PUBLIC]   JS Platform
  33.114 +CLASS      HTMLTableRowElement             [PUBLIC]   JS Platform
  33.115 +CLASS      HTMLTableSectionElement         [PUBLIC]   JS Platform
  33.116 +CLASS      HTMLTextAreaElement             [PUBLIC]   JS Platform
  33.117 +CLASS      HTMLTitleElement                [PUBLIC]   JS Platform
  33.118 +CLASS      HTMLUListElement                [PUBLIC]   JS Platform
  33.119 +CLASS      History                         [PUBLIC]   JS Platform
  33.120 +CLASS      InternalError                   [PUBLIC]   JS Platform
  33.121 +CLASS      Iterator                        [PUBLIC]   JS Platform
  33.122 +CLASS      JSON                            [PUBLIC]   JS Platform
  33.123 +CLASS      LinkStyle                       [PUBLIC]   JS Platform
  33.124 +CLASS      Location                        [PUBLIC]   JS Platform
  33.125 +CLASS      Math                            [PUBLIC]   JS Platform
  33.126 +CLASS      MediaList                       [PUBLIC]   JS Platform
  33.127 +CLASS      MouseEvent                      [PUBLIC]   JS Platform
  33.128 +CLASS      MutationEvent                   [PUBLIC]   JS Platform
  33.129 +CLASS      NameList                        [PUBLIC]   JS Platform
  33.130 +CLASS      NamedNodeMap                    [PUBLIC]   JS Platform
  33.131 +CLASS      Navigator                       [PUBLIC]   JS Platform
  33.132 +CLASS      Node                            [PUBLIC]   JS Platform
  33.133 +CLASS      NodeFilter                      [PUBLIC]   JS Platform
  33.134 +CLASS      NodeIterator                    [PUBLIC]   JS Platform
  33.135 +CLASS      NodeList                        [PUBLIC]   JS Platform
  33.136 +CLASS      Notation                        [PUBLIC]   JS Platform
  33.137 +CLASS      ProcessingInstruction           [PUBLIC]   JS Platform
  33.138 +CLASS      RGBColor                        [PUBLIC]   JS Platform
  33.139 +CLASS      Range                           [PUBLIC]   JS Platform
  33.140 +CLASS      RangeException                  [PUBLIC]   JS Platform
  33.141 +CLASS      Rect                            [PUBLIC]   JS Platform
  33.142 +CLASS      Screen                          [PUBLIC]   JS Platform
  33.143 +CLASS      StopIteration                   [PUBLIC]   JS Platform
  33.144 +CLASS      Storage                         [PUBLIC]   JS Platform
  33.145 +CLASS      StyleSheet                      [PUBLIC]   JS Platform
  33.146 +CLASS      StyleSheetList                  [PUBLIC]   JS Platform
  33.147 +CLASS      Text                            [PUBLIC]   JS Platform
  33.148 +CLASS      TreeWalker                      [PUBLIC]   JS Platform
  33.149 +CLASS      TypeInfo                        [PUBLIC]   JS Platform
  33.150 +CLASS      UIEvent                         [PUBLIC]   JS Platform
  33.151 +CLASS      UserDataHandler                 [PUBLIC]   JS Platform
  33.152 +CLASS      ViewCSS                         [PUBLIC]   JS Platform
  33.153 +CLASS      Window                          [PUBLIC]   JS Platform
  33.154 +CLASS      b                               [PUBLIC]   with1.js
  33.155  CLASS      prototype                       [PUBLIC]   JS Platform
  33.156  CLASS      z                               [PUBLIC]   with3.js
  33.157 -METHOD     Image(width: Number, height: N  [PUBLIC]   JS Platform
  33.158 -METHOD     Option(text: String, value: St  [PUBLIC]   JS Platform
  33.159 +METHOD     Image(width: Number, height: N  [PUBLIC,   JS Platform
  33.160 +METHOD     Option(text: String, value: St  [PUBLIC,   JS Platform
  33.161  METHOD     SyntaxError(): Error            [PUBLIC]   JS Platform
  33.162  METHOD     TypeError(): Error              [PUBLIC]   JS Platform
  33.163  METHOD     URIError(): Error               [PUBLIC]   JS Platform
  33.164 -METHOD     Worker(uri: String): Worker     [PUBLIC]   JS Platform
  33.165 -METHOD     addEventListener(type: String,  [PUBLIC]   JS Platform
  33.166 -METHOD     alert(): undefined              [PUBLIC]   JS Platform
  33.167 -METHOD     atob(encodedData: String): Str  [PUBLIC]   JS Platform
  33.168 -METHOD     back(): undefined               [PUBLIC]   JS Platform
  33.169 -METHOD     blur(): undefined               [PUBLIC]   JS Platform
  33.170 -METHOD     btoa(stringToEncode: String):   [PUBLIC]   JS Platform
  33.171 -METHOD     clearImmediate(immediateID: Nu  [PUBLIC]   JS Platform
  33.172 -METHOD     clearInterval(intervalID: Numb  [PUBLIC]   JS Platform
  33.173 -METHOD     clearTimeout(timeoutID: Number  [PUBLIC]   JS Platform
  33.174 -METHOD     close(): undefined              [PUBLIC]   JS Platform
  33.175 -METHOD     confirm(message: String): Bool  [PUBLIC]   JS Platform
  33.176 +METHOD     Worker(uri: String): window.Wo  [PUBLIC,   JS Platform
  33.177 +METHOD     addEventListener(type: String,  [PUBLIC,   JS Platform
  33.178 +METHOD     alert(): undefined              [PUBLIC,   JS Platform
  33.179 +METHOD     atob(encodedData: String): Str  [PUBLIC,   JS Platform
  33.180 +METHOD     back(): undefined               [PUBLIC,   JS Platform
  33.181 +METHOD     blur(): undefined               [PUBLIC,   JS Platform
  33.182 +METHOD     btoa(stringToEncode: String):   [PUBLIC,   JS Platform
  33.183 +METHOD     clearImmediate(immediateID: Nu  [PUBLIC,   JS Platform
  33.184 +METHOD     clearInterval(intervalID: Numb  [PUBLIC,   JS Platform
  33.185 +METHOD     clearTimeout(timeoutID: Number  [PUBLIC,   JS Platform
  33.186 +METHOD     close(): undefined              [PUBLIC,   JS Platform
  33.187 +METHOD     confirm(message: String): Bool  [PUBLIC,   JS Platform
  33.188  METHOD     create(O: Object): Object       [PUBLIC,   JS Platform
  33.189  METHOD     decodeURI(encodedURI: String):  [PUBLIC]   JS Platform
  33.190  METHOD     decodeURIComponent(encodedURI:  [PUBLIC]   JS Platform
  33.191  METHOD     defineProperties(O: Object, Pr  [PUBLIC,   JS Platform
  33.192  METHOD     defineProperty(O: Object, P: S  [PUBLIC,   JS Platform
  33.193 -METHOD     dump(message: String): undefin  [PUBLIC]   JS Platform
  33.194 +METHOD     dump(message: String): undefin  [PUBLIC,   JS Platform
  33.195  METHOD     encodeURI(URI: String): String  [PUBLIC]   JS Platform
  33.196  METHOD     encodeURIComponent(str: String  [PUBLIC]   JS Platform
  33.197 -METHOD     escape(regular: String): Strin  [PUBLIC]   JS Platform
  33.198 +METHOD     escape(regular: String): Strin  [PUBLIC,   JS Platform
  33.199  METHOD     eval(string: String): Object    [PUBLIC]   JS Platform
  33.200 -METHOD     find(aString: String, aCaseSen  [PUBLIC]   JS Platform
  33.201 -METHOD     focus(): undefined              [PUBLIC]   JS Platform
  33.202 -METHOD     forward(): undefined            [PUBLIC]   JS Platform
  33.203 +METHOD     find(aString: String, aCaseSen  [PUBLIC,   JS Platform
  33.204 +METHOD     focus(): undefined              [PUBLIC,   JS Platform
  33.205 +METHOD     forward(): undefined            [PUBLIC,   JS Platform
  33.206  METHOD     freeze(O: Object): Object       [PUBLIC,   JS Platform
  33.207 -METHOD     getAttention(): undefined       [PUBLIC]   JS Platform
  33.208 -METHOD     getComputedStyle(element: Elem  [PUBLIC]   JS Platform
  33.209 +METHOD     getAttention(): undefined       [PUBLIC,   JS Platform
  33.210 +METHOD     getComputedStyle(element: Elem  [PUBLIC,   JS Platform
  33.211  METHOD     getOwnPropertyDescriptor(O: Ob  [PUBLIC,   JS Platform
  33.212  METHOD     getOwnPropertyNames(O: Object)  [PUBLIC,   JS Platform
  33.213  METHOD     getPrototypeOf(O: Object): Obj  [PUBLIC,   JS Platform
  33.214 -METHOD     getSelection(): Selection       [PUBLIC]   JS Platform
  33.215 +METHOD     getSelection(): Selection       [PUBLIC,   JS Platform
  33.216  METHOD     hasOwnProperty(V: String): Boo  [PUBLIC]   JS Platform
  33.217  METHOD     isExtensible(O: Object): Boole  [PUBLIC,   JS Platform
  33.218  METHOD     isFinite(number: Number): Bool  [PUBLIC]   JS Platform
  33.219 @@ -62,40 +210,41 @@
  33.220  METHOD     isPrototypeOf(V: Object): Bool  [PUBLIC]   JS Platform
  33.221  METHOD     isSealed(O: Object): Boolean    [PUBLIC,   JS Platform
  33.222  METHOD     keys(O: Object): Array          [PUBLIC,   JS Platform
  33.223 -METHOD     matchMedia(mediaQueryString: S  [PUBLIC]   JS Platform
  33.224 -METHOD     moveBy(deltaX: Number, deltaY:  [PUBLIC]   JS Platform
  33.225 -METHOD     moveTo(x: Number, y: Number):   [PUBLIC]   JS Platform
  33.226 -METHOD     open(strUrl: String, strWindow  [PUBLIC]   JS Platform
  33.227 -METHOD     openDialog(url: String, name:   [PUBLIC]   JS Platform
  33.228 +METHOD     matchMedia(mediaQueryString: S  [PUBLIC,   JS Platform
  33.229 +METHOD     moveBy(deltaX: Number, deltaY:  [PUBLIC,   JS Platform
  33.230 +METHOD     moveTo(x: Number, y: Number):   [PUBLIC,   JS Platform
  33.231 +METHOD     open(strUrl: String, strWindow  [PUBLIC,   JS Platform
  33.232 +METHOD     openDialog(url: String, name:   [PUBLIC,   JS Platform
  33.233  METHOD     parseFloat(string: String): Nu  [PUBLIC]   JS Platform
  33.234  METHOD     parseInt(string: String): Numb  [PUBLIC]   JS Platform
  33.235 -METHOD     postMessage(message: String, t  [PUBLIC]   JS Platform
  33.236 +METHOD     postMessage(message: String, t  [PUBLIC,   JS Platform
  33.237  METHOD     preventExtensions(O: Object):   [PUBLIC,   JS Platform
  33.238 -METHOD     print(): undefined              [PUBLIC]   JS Platform
  33.239 -METHOD     prompt(text: String, value: St  [PUBLIC]   JS Platform
  33.240 +METHOD     print(): undefined              [PUBLIC,   JS Platform
  33.241 +METHOD     prompt(text: String, value: St  [PUBLIC,   JS Platform
  33.242  METHOD     propertyIsEnumerable(V: String  [PUBLIC]   JS Platform
  33.243 -METHOD     removeEventListener(type: Stri  [PUBLIC]   JS Platform
  33.244 -METHOD     resizeBy(xDelta: Number, yDelt  [PUBLIC]   JS Platform
  33.245 -METHOD     resizeTo(iWidth: Number, iHeig  [PUBLIC]   JS Platform
  33.246 -METHOD     scroll(xcoord: Number, ycoord:  [PUBLIC]   JS Platform
  33.247 -METHOD     scrollBy(X: Number, Y: Number)  [PUBLIC]   JS Platform
  33.248 -METHOD     scrollByLines(lines: Number):   [PUBLIC]   JS Platform
  33.249 -METHOD     scrollByPages(pages: Number):   [PUBLIC]   JS Platform
  33.250 -METHOD     scrollTo(xcoord: Number, ycoor  [PUBLIC]   JS Platform
  33.251 +METHOD     removeEventListener(type: Stri  [PUBLIC,   JS Platform
  33.252 +METHOD     resizeBy(xDelta: Number, yDelt  [PUBLIC,   JS Platform
  33.253 +METHOD     resizeTo(iWidth: Number, iHeig  [PUBLIC,   JS Platform
  33.254 +METHOD     scroll(xcoord: Number, ycoord:  [PUBLIC,   JS Platform
  33.255 +METHOD     scrollBy(X: Number, Y: Number)  [PUBLIC,   JS Platform
  33.256 +METHOD     scrollByLines(lines: Number):   [PUBLIC,   JS Platform
  33.257 +METHOD     scrollByPages(pages: Number):   [PUBLIC,   JS Platform
  33.258 +METHOD     scrollTo(xcoord: Number, ycoor  [PUBLIC,   JS Platform
  33.259  METHOD     seal(O: Object): Object         [PUBLIC,   JS Platform
  33.260 -METHOD     setCursor(): undefined          [PUBLIC]   JS Platform
  33.261 -METHOD     setImmediate(func: Function):   [PUBLIC]   JS Platform
  33.262 -METHOD     setInterval(func: Function, de  [PUBLIC]   JS Platform
  33.263 -METHOD     setTimeout(func: Function, del  [PUBLIC]   JS Platform
  33.264 -METHOD     showModalDialog(uri: String):   [PUBLIC]   JS Platform
  33.265 -METHOD     sizeToContent(): undefined      [PUBLIC]   JS Platform
  33.266 -METHOD     stop(): undefined               [PUBLIC]   JS Platform
  33.267 +METHOD     setCursor(): undefined          [PUBLIC,   JS Platform
  33.268 +METHOD     setImmediate(func: Function):   [PUBLIC,   JS Platform
  33.269 +METHOD     setInterval(func: Function, de  [PUBLIC,   JS Platform
  33.270 +METHOD     setTimeout(func: Function, del  [PUBLIC,   JS Platform
  33.271 +METHOD     showModalDialog(uri: String):   [PUBLIC,   JS Platform
  33.272 +METHOD     sizeToContent(): undefined      [PUBLIC,   JS Platform
  33.273 +METHOD     stop(): undefined               [PUBLIC,   JS Platform
  33.274  METHOD     toLocaleString(): String        [PUBLIC]   JS Platform
  33.275  METHOD     toString(): String              [PUBLIC]   JS Platform
  33.276 -METHOD     unescape(escaped: String): Str  [PUBLIC]   JS Platform
  33.277 -METHOD     updateCommands(sCommandName):   [PUBLIC]   JS Platform
  33.278 +METHOD     unescape(escaped: String): Str  [PUBLIC,   JS Platform
  33.279 +METHOD     uneval(): Number                [PUBLIC]   JS Platform
  33.280 +METHOD     updateCommands(sCommandName):   [PUBLIC,   JS Platform
  33.281  METHOD     valueOf(): Object               [PUBLIC]   JS Platform
  33.282 -FIELD      Components: window.Components   [PUBLIC]   JS Platform
  33.283 +FIELD      Components: Components          [PUBLIC]   JS Platform
  33.284  FIELD      applicationCache: Object        [PUBLIC]   JS Platform
  33.285  FIELD      closed: Boolean                 [PUBLIC]   JS Platform
  33.286  FIELD      console: Console                [PUBLIC]   JS Platform
  33.287 @@ -105,7 +254,7 @@
  33.288  FIELD      crypto: Crypto                  [PUBLIC]   JS Platform
  33.289  FIELD      defaultStatus: String           [PUBLIC]   JS Platform
  33.290  FIELD      dialogArguments: Object         [PUBLIC]   JS Platform
  33.291 -FIELD      document: window.document       [PUBLIC]   JS Platform
  33.292 +FIELD      document: document              [PUBLIC]   JS Platform
  33.293  FIELD      frameElement: Element           [PUBLIC]   JS Platform
  33.294  FIELD      frames: Array                   [PUBLIC]   JS Platform
  33.295  FIELD      fullScreen: Boolean             [PUBLIC]   JS Platform
  33.296 @@ -173,154 +322,10 @@
  33.297  FIELD      window: Window                  [PUBLIC]   JS Platform
  33.298  FIELD      x: String                       [PUBLIC]   with3.js
  33.299  FIELD      y: Number                       [PUBLIC]   with3.js
  33.300 -VARIABLE   AbstractView                    [PUBLIC]   JS Platform
  33.301 -VARIABLE   Attr                            [PUBLIC]   JS Platform
  33.302 -VARIABLE   CDATASection                    [PUBLIC]   JS Platform
  33.303 -VARIABLE   CSS2Properties                  [PUBLIC]   JS Platform
  33.304 -VARIABLE   CSSCharsetRule                  [PUBLIC]   JS Platform
  33.305 -VARIABLE   CSSFontFaceRule                 [PUBLIC]   JS Platform
  33.306 -VARIABLE   CSSImportRule                   [PUBLIC]   JS Platform
  33.307 -VARIABLE   CSSMediaRule                    [PUBLIC]   JS Platform
  33.308 -VARIABLE   CSSPageRule                     [PUBLIC]   JS Platform
  33.309 -VARIABLE   CSSPrimitiveValue               [PUBLIC]   JS Platform
  33.310 -VARIABLE   CSSRule                         [PUBLIC]   JS Platform
  33.311 -VARIABLE   CSSRuleList                     [PUBLIC]   JS Platform
  33.312 -VARIABLE   CSSStyleDeclaration             [PUBLIC]   JS Platform
  33.313 -VARIABLE   CSSStyleRule                    [PUBLIC]   JS Platform
  33.314 -VARIABLE   CSSStyleSheet                   [PUBLIC]   JS Platform
  33.315 -VARIABLE   CSSUnknownRule                  [PUBLIC]   JS Platform
  33.316 -VARIABLE   CSSValue                        [PUBLIC]   JS Platform
  33.317 -VARIABLE   CSSValueList                    [PUBLIC]   JS Platform
  33.318 -VARIABLE   CharacterData                   [PUBLIC]   JS Platform
  33.319 -VARIABLE   Comment                         [PUBLIC]   JS Platform
  33.320 -VARIABLE   Console                         [PUBLIC]   JS Platform
  33.321 -VARIABLE   Counter                         [PUBLIC]   JS Platform
  33.322 -VARIABLE   Crypto                          [PUBLIC]   JS Platform
  33.323 -VARIABLE   DOMConfiguration                [PUBLIC]   JS Platform
  33.324 -VARIABLE   DOMError                        [PUBLIC]   JS Platform
  33.325 -VARIABLE   DOMErrorHandler                 [PUBLIC]   JS Platform
  33.326 -VARIABLE   DOMException                    [PUBLIC]   JS Platform
  33.327 -VARIABLE   DOMImplementation               [PUBLIC]   JS Platform
  33.328 -VARIABLE   DOMImplementationCSS            [PUBLIC]   JS Platform
  33.329 -VARIABLE   DOMImplementationList           [PUBLIC]   JS Platform
  33.330 -VARIABLE   DOMImplementationSource         [PUBLIC]   JS Platform
  33.331 -VARIABLE   DOMLocator                      [PUBLIC]   JS Platform
  33.332 -VARIABLE   DOMObject                       [PUBLIC]   JS Platform
  33.333 -VARIABLE   DOMString                       [PUBLIC]   JS Platform
  33.334 -VARIABLE   DOMStringList                   [PUBLIC]   JS Platform
  33.335 -VARIABLE   DOMTimeStamp                    [PUBLIC]   JS Platform
  33.336 -VARIABLE   DOMUserData                     [PUBLIC]   JS Platform
  33.337 -VARIABLE   Document: Node                  [PUBLIC]   JS Platform
  33.338 -VARIABLE   DocumentCSS                     [PUBLIC]   JS Platform
  33.339 -VARIABLE   DocumentEvent                   [PUBLIC]   JS Platform
  33.340 -VARIABLE   DocumentFragment                [PUBLIC]   JS Platform
  33.341 -VARIABLE   DocumentRange                   [PUBLIC]   JS Platform
  33.342 -VARIABLE   DocumentStyle                   [PUBLIC]   JS Platform
  33.343 -VARIABLE   DocumentTraversal               [PUBLIC]   JS Platform
  33.344 -VARIABLE   DocumentType                    [PUBLIC]   JS Platform
  33.345 -VARIABLE   DocumentView                    [PUBLIC]   JS Platform
  33.346 -VARIABLE   Element: Node                   [PUBLIC]   JS Platform
  33.347 -VARIABLE   ElementCSSInlineStyle           [PUBLIC]   JS Platform
  33.348 -VARIABLE   ElementTraversal                [PUBLIC]   JS Platform
  33.349 -VARIABLE   Entity                          [PUBLIC]   JS Platform
  33.350 -VARIABLE   EntityReference                 [PUBLIC]   JS Platform
  33.351 -VARIABLE   Event                           [PUBLIC]   JS Platform
  33.352 -VARIABLE   EventException                  [PUBLIC]   JS Platform
  33.353 -VARIABLE   EventListener                   [PUBLIC]   JS Platform
  33.354 -VARIABLE   EventTarget                     [PUBLIC]   JS Platform
  33.355 -VARIABLE   HTMLAnchorElement               [PUBLIC]   JS Platform
  33.356 -VARIABLE   HTMLAppletElement               [PUBLIC]   JS Platform
  33.357 -VARIABLE   HTMLAreaElement                 [PUBLIC]   JS Platform
  33.358 -VARIABLE   HTMLBRElement                   [PUBLIC]   JS Platform
  33.359 -VARIABLE   HTMLBaseElement                 [PUBLIC]   JS Platform
  33.360 -VARIABLE   HTMLBaseFontElement             [PUBLIC]   JS Platform
  33.361 -VARIABLE   HTMLBodyElement                 [PUBLIC]   JS Platform
  33.362 -VARIABLE   HTMLButtonElement               [PUBLIC]   JS Platform
  33.363 -VARIABLE   HTMLCollection                  [PUBLIC]   JS Platform
  33.364 -VARIABLE   HTMLDListElement                [PUBLIC]   JS Platform
  33.365 -VARIABLE   HTMLDirectoryElement            [PUBLIC]   JS Platform
  33.366 -VARIABLE   HTMLDivElement                  [PUBLIC]   JS Platform
  33.367 -VARIABLE   HTMLDocument: Document          [PUBLIC]   JS Platform
  33.368 -VARIABLE   HTMLElement: Element            [PUBLIC]   JS Platform
  33.369 -VARIABLE   HTMLFieldSetElement             [PUBLIC]   JS Platform
  33.370 -VARIABLE   HTMLFontElement                 [PUBLIC]   JS Platform
  33.371 -VARIABLE   HTMLFormElement                 [PUBLIC]   JS Platform
  33.372 -VARIABLE   HTMLFrameElement                [PUBLIC]   JS Platform
  33.373 -VARIABLE   HTMLFrameSetElement             [PUBLIC]   JS Platform
  33.374 -VARIABLE   HTMLHRElement                   [PUBLIC]   JS Platform
  33.375 -VARIABLE   HTMLHeadElement                 [PUBLIC]   JS Platform
  33.376 -VARIABLE   HTMLHeadingElement              [PUBLIC]   JS Platform
  33.377 -VARIABLE   HTMLHtmlElement                 [PUBLIC]   JS Platform
  33.378 -VARIABLE   HTMLIFrameElement               [PUBLIC]   JS Platform
  33.379 -VARIABLE   HTMLImageElement                [PUBLIC]   JS Platform
  33.380 -VARIABLE   HTMLInputElement                [PUBLIC]   JS Platform
  33.381 -VARIABLE   HTMLIsIndexElement              [PUBLIC]   JS Platform
  33.382 -VARIABLE   HTMLLIElement                   [PUBLIC]   JS Platform
  33.383 -VARIABLE   HTMLLabelElement                [PUBLIC]   JS Platform
  33.384 -VARIABLE   HTMLLegendElement               [PUBLIC]   JS Platform
  33.385 -VARIABLE   HTMLLinkElement                 [PUBLIC]   JS Platform
  33.386 -VARIABLE   HTMLMapElement                  [PUBLIC]   JS Platform
  33.387 -VARIABLE   HTMLMenuElement                 [PUBLIC]   JS Platform
  33.388 -VARIABLE   HTMLMetaElement                 [PUBLIC]   JS Platform
  33.389 -VARIABLE   HTMLModElement                  [PUBLIC]   JS Platform
  33.390 -VARIABLE   HTMLOListElement                [PUBLIC]   JS Platform
  33.391 -VARIABLE   HTMLObjectElement               [PUBLIC]   JS Platform
  33.392 -VARIABLE   HTMLOptGroupElement             [PUBLIC]   JS Platform
  33.393 -VARIABLE   HTMLOptionElement               [PUBLIC]   JS Platform
  33.394 -VARIABLE   HTMLOptionsCollection           [PUBLIC]   JS Platform
  33.395 -VARIABLE   HTMLParagraphElement            [PUBLIC]   JS Platform
  33.396 -VARIABLE   HTMLParamElement                [PUBLIC]   JS Platform
  33.397 -VARIABLE   HTMLPreElement                  [PUBLIC]   JS Platform
  33.398 -VARIABLE   HTMLQuoteElement                [PUBLIC]   JS Platform
  33.399 -VARIABLE   HTMLScriptElement               [PUBLIC]   JS Platform
  33.400 -VARIABLE   HTMLSelectElement               [PUBLIC]   JS Platform
  33.401 -VARIABLE   HTMLStyleElement                [PUBLIC]   JS Platform
  33.402 -VARIABLE   HTMLTableCaptionElement         [PUBLIC]   JS Platform
  33.403 -VARIABLE   HTMLTableCellElement            [PUBLIC]   JS Platform
  33.404 -VARIABLE   HTMLTableColElement             [PUBLIC]   JS Platform
  33.405 -VARIABLE   HTMLTableElement                [PUBLIC]   JS Platform
  33.406 -VARIABLE   HTMLTableRowElement             [PUBLIC]   JS Platform
  33.407 -VARIABLE   HTMLTableSectionElement         [PUBLIC]   JS Platform
  33.408 -VARIABLE   HTMLTextAreaElement             [PUBLIC]   JS Platform
  33.409 -VARIABLE   HTMLTitleElement                [PUBLIC]   JS Platform
  33.410 -VARIABLE   HTMLUListElement                [PUBLIC]   JS Platform
  33.411 -VARIABLE   History                         [PUBLIC]   JS Platform
  33.412  VARIABLE   Infinity: Number                [PUBLIC]   JS Platform
  33.413 -VARIABLE   JSON                            [PUBLIC]   JS Platform
  33.414 -VARIABLE   LinkStyle                       [PUBLIC]   JS Platform
  33.415 -VARIABLE   Location                        [PUBLIC]   JS Platform
  33.416 -VARIABLE   Math                            [PUBLIC]   JS Platform
  33.417 -VARIABLE   MediaList                       [PUBLIC]   JS Platform
  33.418 -VARIABLE   MouseEvent                      [PUBLIC]   JS Platform
  33.419 -VARIABLE   MutationEvent                   [PUBLIC]   JS Platform
  33.420  VARIABLE   NaN: Number                     [PUBLIC]   JS Platform
  33.421 -VARIABLE   NameList                        [PUBLIC]   JS Platform
  33.422 -VARIABLE   NamedNodeMap                    [PUBLIC]   JS Platform
  33.423 -VARIABLE   Navigator                       [PUBLIC]   JS Platform
  33.424 -VARIABLE   Node                            [PUBLIC]   JS Platform
  33.425 -VARIABLE   NodeFilter                      [PUBLIC]   JS Platform
  33.426 -VARIABLE   NodeIterator                    [PUBLIC]   JS Platform
  33.427 -VARIABLE   NodeList                        [PUBLIC]   JS Platform
  33.428 -VARIABLE   Notation                        [PUBLIC]   JS Platform
  33.429 -VARIABLE   ProcessingInstruction           [PUBLIC]   JS Platform
  33.430 -VARIABLE   RGBColor                        [PUBLIC]   JS Platform
  33.431 -VARIABLE   Range                           [PUBLIC]   JS Platform
  33.432 -VARIABLE   RangeException                  [PUBLIC]   JS Platform
  33.433 -VARIABLE   Rect                            [PUBLIC]   JS Platform
  33.434 -VARIABLE   Screen                          [PUBLIC]   JS Platform
  33.435 -VARIABLE   Storage                         [PUBLIC]   JS Platform
  33.436 -VARIABLE   StyleSheet                      [PUBLIC]   JS Platform
  33.437 -VARIABLE   StyleSheetList                  [PUBLIC]   JS Platform
  33.438 -VARIABLE   Text                            [PUBLIC]   JS Platform
  33.439 -VARIABLE   TreeWalker                      [PUBLIC]   JS Platform
  33.440 -VARIABLE   TypeInfo                        [PUBLIC]   JS Platform
  33.441 -VARIABLE   UIEvent                         [PUBLIC]   JS Platform
  33.442 -VARIABLE   UserDataHandler                 [PUBLIC]   JS Platform
  33.443 -VARIABLE   ViewCSS                         [PUBLIC]   JS Platform
  33.444 -VARIABLE   Window                          [PUBLIC]   JS Platform
  33.445 -VARIABLE   b                               [PUBLIC]   with1.js
  33.446 +VARIABLE   Proxy                           [PUBLIC]   JS Platform
  33.447  VARIABLE   undefined: undefined            [PUBLIC]   JS Platform
  33.448 -VARIABLE   z                               [PUBLIC]   with1.js
  33.449  KEYWORD    break                                      null
  33.450  KEYWORD    case                                       null
  33.451  KEYWORD    catch                                      null
    34.1 --- a/javascript2.editor/test/unit/data/testfiles/completion/withAnonymous/with5.js.testWith5.completion	Tue Aug 13 14:01:33 2013 +0200
    34.2 +++ b/javascript2.editor/test/unit/data/testfiles/completion/withAnonymous/with5.js.testWith5.completion	Tue Aug 13 14:38:34 2013 +0200
    34.3 @@ -16,6 +16,7 @@
    34.4  CONSTRUCTO String(): String                [PUBLIC]   JS Platform
    34.5  CONSTRUCTO XMLHttpRequest(): XMLHttpReque  [PUBLIC]   JS Platform
    34.6  CLASS      AbstractView                    [PUBLIC]   JS Platform
    34.7 +CLASS      Arguments                       [PUBLIC]   JS Platform
    34.8  CLASS      Attr                            [PUBLIC]   JS Platform
    34.9  CLASS      CDATASection                    [PUBLIC]   JS Platform
   34.10  CLASS      CSS2Properties                  [PUBLIC]   JS Platform
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232776.js	Tue Aug 13 14:38:34 2013 +0200
    35.3 @@ -0,0 +1,12 @@
    35.4 +var testWith01 = {
    35.5 +    prop01: "ahoj",
    35.6 +    prop02: 20,
    35.7 +    method01: function() {
    35.8 +
    35.9 +    }
   35.10 +}
   35.11 +
   35.12 +with (testWith01) {
   35.13 +    prop01 = prop01 + prop02;
   35.14 +    method01();
   35.15 +}
   35.16 \ No newline at end of file
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232776.js.testIssue232776_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    36.3 @@ -0,0 +1,2 @@
    36.4 +    |>MARK_OCCURRENCES:prop01<|: "ahoj",
    36.5 +    |>MARK_OCCURRENCES:p^rop01<| = |>MARK_OCCURRENCES:prop01<| + prop02;
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232776.js.testIssue232776_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    37.3 @@ -0,0 +1,2 @@
    37.4 +    |>MARK_OCCURRENCES:prop02<|: 20,
    37.5 +    prop01 = prop01 + |>MARK_OCCURRENCES:pro^p02<|;
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232776.js.testIssue232776_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
    38.3 @@ -0,0 +1,2 @@
    38.4 +    |>MARK_OCCURRENCES:method01<|: function() {
    38.5 +    |>MARK_OCCURRENCES:metho^d01<|();
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232776.js.testIssue232776_04.occurrences	Tue Aug 13 14:38:34 2013 +0200
    39.3 @@ -0,0 +1,2 @@
    39.4 +var |>MARK_OCCURRENCES:testWith01<| = {
    39.5 +with (|>MARK_OCCURRENCES:testWi^th01<|) {
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232777.js	Tue Aug 13 14:38:34 2013 +0200
    40.3 @@ -0,0 +1,13 @@
    40.4 +var testWith02 = {
    40.5 +    app : {
    40.6 +        name: "some name",
    40.7 +        description: "some description",
    40.8 +        getUsages : function() { return 0;}
    40.9 +
   40.10 +    }
   40.11 +
   40.12 +}
   40.13 +
   40.14 +with (testWith02) {
   40.15 +    app.description = "new description";
   40.16 +}
   40.17 \ No newline at end of file
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232777.js.testIssue232777_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    41.3 @@ -0,0 +1,2 @@
    41.4 +        |>MARK_OCCURRENCES:description<|: "some description",
    41.5 +    app.|>MARK_OCCURRENCES:des^cription<| = "new description";
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232777.js.testIssue232777_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    42.3 @@ -0,0 +1,2 @@
    42.4 +    |>MARK_OCCURRENCES:app<| : {
    42.5 +    |>MARK_OCCURRENCES:ap^p<|.description = "new description";
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js	Tue Aug 13 14:38:34 2013 +0200
    43.3 @@ -0,0 +1,37 @@
    43.4 +   
    43.5 +function getInfo() {
    43.6 +    console.log("getInfo from global");
    43.7 +}
    43.8 +
    43.9 +function getGlobal() {
   43.10 +    console.log("global");
   43.11 +}
   43.12 +
   43.13 +var A = {
   43.14 +    getInfo: function () {
   43.15 +        console.log("getInfo from A");
   43.16 +    },
   43.17 +    getName: function() {
   43.18 +        console.log("A");
   43.19 +    },
   43.20 +    B: {},
   43.21 +    monitor : 24
   43.22 +};
   43.23 +  
   43.24 +with(A) {
   43.25 +    getInfo();
   43.26 +     // try here
   43.27 +    getGlobal();
   43.28 +    getName();
   43.29 +    B.getName = function () {
   43.30 +        console.log("B");
   43.31 +        this.c // issue 232798
   43.32 +    };     
   43.33 +    B.createBuf = function () {
   43.34 +        console.log("create buf");
   43.35 +    };
   43.36 +    
   43.37 +}   
   43.38 +
   43.39 +A.getName();
   43.40 +A.B.getName(); 
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js.structure	Tue Aug 13 14:38:34 2013 +0200
    44.3 @@ -0,0 +1,10 @@
    44.4 +A:CLASS:[PUBLIC]:ESCAPED{A}:
    44.5 +  B:CLASS:[PUBLIC]:ESCAPED{B}:
    44.6 +    c:FIELD:[PUBLIC]:ESCAPED{c}:
    44.7 +    createBuf:METHOD:[PUBLIC]:ESCAPED{createBuf}ESCAPED{(}ESCAPED{)}<font color="#999999">ESCAPED{ : }undefined</font>:
    44.8 +    getName:METHOD:[PUBLIC]:ESCAPED{getName}ESCAPED{(}ESCAPED{)}<font color="#999999">ESCAPED{ : }undefined</font>:
    44.9 +  getInfo:METHOD:[PUBLIC]:ESCAPED{getInfo}ESCAPED{(}ESCAPED{)}<font color="#999999">ESCAPED{ : }undefined</font>:
   44.10 +  getName:METHOD:[PUBLIC]:ESCAPED{getName}ESCAPED{(}ESCAPED{)}<font color="#999999">ESCAPED{ : }undefined</font>:
   44.11 +  monitor:FIELD:[PUBLIC]:ESCAPED{monitor}<font color="#999999">ESCAPED{ : }Number</font>:
   44.12 +getGlobal:METHOD:[PUBLIC]:ESCAPED{getGlobal}ESCAPED{(}ESCAPED{)}<font color="#999999">ESCAPED{ : }undefined</font>:
   44.13 +getInfo:METHOD:[PUBLIC]:ESCAPED{getInfo}ESCAPED{(}ESCAPED{)}<font color="#999999">ESCAPED{ : }undefined</font>:
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js.testCCinWith01.completion	Tue Aug 13 14:38:34 2013 +0200
    45.3 @@ -0,0 +1,40 @@
    45.4 +Code completion result for source line:
    45.5 +| // try here
    45.6 +(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
    45.7 +------------------------------------
    45.8 +CLASS      A                               [PUBLIC]   issue232792.js
    45.9 +CLASS      B                               [PUBLIC]   issue232792.js
   45.10 +CLASS      console                         [PUBLIC]   issue232792.js
   45.11 +METHOD     getGlobal(): undefined          [PUBLIC]   issue232792.js
   45.12 +METHOD     getInfo(): undefined            [PUBLIC]   issue232792.js
   45.13 +METHOD     getInfo(): undefined            [PUBLIC]   issue232792.js
   45.14 +METHOD     getName(): undefined            [PUBLIC]   issue232792.js
   45.15 +FIELD      monitor: Number                 [PUBLIC]   issue232792.js
   45.16 +KEYWORD    break                                      null
   45.17 +KEYWORD    case                                       null
   45.18 +KEYWORD    catch                                      null
   45.19 +KEYWORD    continue                                   null
   45.20 +KEYWORD    debugger                                   null
   45.21 +KEYWORD    default                                    null
   45.22 +KEYWORD    delete                                     null
   45.23 +KEYWORD    do                                         null
   45.24 +KEYWORD    else                                       null
   45.25 +KEYWORD    false                                      null
   45.26 +KEYWORD    finally                                    null
   45.27 +KEYWORD    for                                        null
   45.28 +KEYWORD    function                                   null
   45.29 +KEYWORD    if                                         null
   45.30 +KEYWORD    in                                         null
   45.31 +KEYWORD    instanceof                                 null
   45.32 +KEYWORD    new                                        null
   45.33 +KEYWORD    return                                     null
   45.34 +KEYWORD    switch                                     null
   45.35 +KEYWORD    this                                       null
   45.36 +KEYWORD    throw                                      null
   45.37 +KEYWORD    true                                       null
   45.38 +KEYWORD    try                                        null
   45.39 +KEYWORD    typeof                                     null
   45.40 +KEYWORD    var                                        null
   45.41 +KEYWORD    void                                       null
   45.42 +KEYWORD    while                                      null
   45.43 +KEYWORD    with                                       null
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js.testIssue23277.completion	Tue Aug 13 14:38:34 2013 +0200
    46.3 @@ -0,0 +1,7 @@
    46.4 +Code completion result for source line:
    46.5 +A.B.|getName();
    46.6 +(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
    46.7 +------------------------------------
    46.8 +METHOD     createBuf(): undefined          [PUBLIC]   issue232792.js
    46.9 +METHOD     getName(): undefined            [PUBLIC]   issue232792.js
   46.10 +FIELD      c                               [PUBLIC]   issue232792.js
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js.testIssue232792_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    47.3 @@ -0,0 +1,2 @@
    47.4 +    |>MARK_OCCURRENCES:getInfo<|: function () {
    47.5 +    |>MARK_OCCURRENCES:getI^nfo<|();
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js.testIssue232792_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    48.3 @@ -0,0 +1,3 @@
    48.4 +    |>MARK_OCCURRENCES:getName<|: function() {
    48.5 +    |>MARK_OCCURRENCES:getName<|();
    48.6 +A.|>MARK_OCCURRENCES:getN^ame<|();
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js.testIssue232792_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
    49.3 @@ -0,0 +1,2 @@
    49.4 +    B.|>MARK_OCCURRENCES:getName<| = function () {
    49.5 +A.B.|>MARK_OCCURRENCES:getN^ame<|(); 
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232792.js.testIssue232798.completion	Tue Aug 13 14:38:34 2013 +0200
    50.3 @@ -0,0 +1,7 @@
    50.4 +Code completion result for source line:
    50.5 +this.|c // issue 232798
    50.6 +(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
    50.7 +------------------------------------
    50.8 +METHOD     createBuf(): undefined          [PUBLIC]   issue232792.js
    50.9 +METHOD     getName(): undefined            [PUBLIC]   issue232792.js
   50.10 +FIELD      c                               [PUBLIC]   issue232792.js
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232804.js	Tue Aug 13 14:38:34 2013 +0200
    51.3 @@ -0,0 +1,16 @@
    51.4 +(function () {
    51.5 +var testWith02 = {
    51.6 +    app : {
    51.7 +        name: "some name",
    51.8 +        description: "some description",
    51.9 +        getUsages : function() { return 0;}
   51.10 +        
   51.11 +    }
   51.12 +    
   51.13 +}
   51.14 +   
   51.15 +with (testWith02) {
   51.16 +    app.description = "new description";
   51.17 +    console.log(app.description);
   51.18 +}
   51.19 +})();
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232804.js.semantic	Tue Aug 13 14:38:34 2013 +0200
    52.3 @@ -0,0 +1,16 @@
    52.4 +(function () {
    52.5 +var |>CLASS:testWith02<| = {
    52.6 +    |>CLASS:app<| : {
    52.7 +        |>FIELD:name<|: "some name",
    52.8 +        |>FIELD:description<|: "some description",
    52.9 +        |>METHOD:getUsages<| : function() { return 0;}
   52.10 +        
   52.11 +    }
   52.12 +    
   52.13 +}
   52.14 +   
   52.15 +with (testWith02) {
   52.16 +    app.|>FIELD:description<| = "new description";
   52.17 +    |>GLOBAL:console<|.log(app.|>FIELD:description<|);
   52.18 +}
   52.19 +})();
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232804.js.structure	Tue Aug 13 14:38:34 2013 +0200
    53.3 @@ -0,0 +1,5 @@
    53.4 +testWith02:CLASS:[PRIVATE]:ESCAPED{testWith02}:
    53.5 +  app:CLASS:[PUBLIC]:ESCAPED{app}:
    53.6 +    description:FIELD:[PUBLIC]:ESCAPED{description}<font color="#999999">ESCAPED{ : }String</font>:
    53.7 +    getUsages:METHOD:[PUBLIC]:ESCAPED{getUsages}ESCAPED{(}ESCAPED{)}<font color="#999999">ESCAPED{ : }Number</font>:
    53.8 +    name:FIELD:[PUBLIC]:ESCAPED{name}<font color="#999999">ESCAPED{ : }String</font>:
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232804.js.testIssue232804_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    54.3 @@ -0,0 +1,2 @@
    54.4 +var |>MARK_OCCURRENCES:testWith02<| = {
    54.5 +with (|>MARK_OCCURRENCES:tes^tWith02<|) {
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/javascript2.editor/test/unit/data/testfiles/markoccurences/issue232804.js.testIssue232804_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    55.3 @@ -0,0 +1,3 @@
    55.4 +        |>MARK_OCCURRENCES:description<|: "some description",
    55.5 +    app.|>MARK_OCCURRENCES:description<| = "new description";
    55.6 +    console.log(app.|>MARK_OCCURRENCES:desc^ription<|);
    56.1 --- a/javascript2.editor/test/unit/data/testfiles/model/simpleObject.js.testSimpleObject01.completion	Tue Aug 13 14:01:33 2013 +0200
    56.2 +++ b/javascript2.editor/test/unit/data/testfiles/model/simpleObject.js.testSimpleObject01.completion	Tue Aug 13 14:38:34 2013 +0200
    56.3 @@ -1,3 +1,8 @@
    56.4  Code completion result for source line:
    56.5  this.called = this.|called + 1;
    56.6  (QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
    56.7 +------------------------------------
    56.8 +METHOD     getColor(): String              [PUBLIC]   simpleObject.js
    56.9 +METHOD     isVegitable(): Boolean          [PUBLIC]   simpleObject.js
   56.10 +FIELD      called                          [PUBLIC]   simpleObject.js
   56.11 +FIELD      color: String                   [PUBLIC]   simpleObject.js
    57.1 --- a/javascript2.editor/test/unit/data/testfiles/model/simpleObject.js.testSimpleObject02.completion	Tue Aug 13 14:01:33 2013 +0200
    57.2 +++ b/javascript2.editor/test/unit/data/testfiles/model/simpleObject.js.testSimpleObject02.completion	Tue Aug 13 14:38:34 2013 +0200
    57.3 @@ -1,3 +1,5 @@
    57.4  Code completion result for source line:
    57.5  this.called = this.cal|led + 1;
    57.6  (QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
    57.7 +------------------------------------
    57.8 +FIELD      called                          [PUBLIC]   simpleObject.js
    58.1 --- a/javascript2.editor/test/unit/data/testfiles/model/simpleObject.js.testSimpleObject03.completion	Tue Aug 13 14:01:33 2013 +0200
    58.2 +++ b/javascript2.editor/test/unit/data/testfiles/model/simpleObject.js.testSimpleObject03.completion	Tue Aug 13 14:38:34 2013 +0200
    58.3 @@ -1,3 +1,8 @@
    58.4  Code completion result for source line:
    58.5  if (this.|color === "red") {
    58.6  (QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
    58.7 +------------------------------------
    58.8 +METHOD     getColor(): String              [PUBLIC]   simpleObject.js
    58.9 +METHOD     isVegitable(): Boolean          [PUBLIC]   simpleObject.js
   58.10 +FIELD      called: Number                  [PUBLIC]   simpleObject.js
   58.11 +FIELD      color: String                   [PUBLIC]   simpleObject.js
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js	Tue Aug 13 14:38:34 2013 +0200
    59.3 @@ -0,0 +1,16 @@
    59.4 +var man01 = {
    59.5 +    firstName : "Pepa",
    59.6 +    secondName: "Vyskoc"
    59.7 +};
    59.8 +
    59.9 +var address01 = {
   59.10 +    street: "Kolesa",
   59.11 +    city: "Kladruby"
   59.12 +};
   59.13 +
   59.14 +with (man01) {
   59.15 +    console.log(firstName);
   59.16 +    with(address01) {
   59.17 +        console.log(street);
   59.18 +    }
   59.19 +}
   59.20 \ No newline at end of file
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.semantic	Tue Aug 13 14:38:34 2013 +0200
    60.3 @@ -0,0 +1,16 @@
    60.4 +var |>GLOBAL:man01<| = {
    60.5 +    |>FIELD:firstName<| : "Pepa",
    60.6 +    |>FIELD:secondName<|: "Vyskoc"
    60.7 +};
    60.8 +
    60.9 +var |>GLOBAL:address01<| = {
   60.10 +    |>FIELD:street<|: "Kolesa",
   60.11 +    |>FIELD:city<|: "Kladruby"
   60.12 +};
   60.13 +
   60.14 +with (|>GLOBAL:man01<|) {
   60.15 +    |>GLOBAL:console<|.log(|>FIELD:firstName<|);
   60.16 +    with(|>GLOBAL:address01<|) {
   60.17 +        |>GLOBAL:console<|.log(|>FIELD:street<|);
   60.18 +    }
   60.19 +}
   60.20 \ No newline at end of file
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.structure	Tue Aug 13 14:38:34 2013 +0200
    61.3 @@ -0,0 +1,6 @@
    61.4 +address01:CLASS:[PUBLIC]:ESCAPED{address01}:
    61.5 +  city:FIELD:[PUBLIC]:ESCAPED{city}<font color="#999999">ESCAPED{ : }String</font>:
    61.6 +  street:FIELD:[PUBLIC]:ESCAPED{street}<font color="#999999">ESCAPED{ : }String</font>:
    61.7 +man01:CLASS:[PUBLIC]:ESCAPED{man01}:
    61.8 +  firstName:FIELD:[PUBLIC]:ESCAPED{firstName}<font color="#999999">ESCAPED{ : }String</font>:
    61.9 +  secondName:FIELD:[PUBLIC]:ESCAPED{secondName}<font color="#999999">ESCAPED{ : }String</font>:
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.testInner01_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    62.3 @@ -0,0 +1,2 @@
    62.4 +    |>MARK_OCCURRENCES:street<|: "Kolesa",
    62.5 +        console.log(|>MARK_OCCURRENCES:st^reet<|);
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.testInner01_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    63.3 @@ -0,0 +1,2 @@
    63.4 +    console.|>MARK_OCCURRENCES:log<|(firstName);
    63.5 +        console.|>MARK_OCCURRENCES:lo^g<|(street);
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.testInner01_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
    64.3 @@ -0,0 +1,2 @@
    64.4 +    |>MARK_OCCURRENCES:console<|.log(firstName);
    64.5 +        |>MARK_OCCURRENCES:con^sole<|.log(street);
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.testInner01_04.occurrences	Tue Aug 13 14:38:34 2013 +0200
    65.3 @@ -0,0 +1,2 @@
    65.4 +var |>MARK_OCCURRENCES:address01<| = {
    65.5 +    with(|>MARK_OCCURRENCES:addres^s01<|) {
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.testInner01_05.occurrences	Tue Aug 13 14:38:34 2013 +0200
    66.3 @@ -0,0 +1,2 @@
    66.4 +var |>MARK_OCCURRENCES:man01<| = {
    66.5 +with (|>MARK_OCCURRENCES:m^an01<|) {
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner01.js.testInner01_06.occurrences	Tue Aug 13 14:38:34 2013 +0200
    67.3 @@ -0,0 +1,2 @@
    67.4 +    |>MARK_OCCURRENCES:firstName<| : "Pepa",
    67.5 +    console.log(|>MARK_OCCURRENCES:firstN^ame<|);
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js	Tue Aug 13 14:38:34 2013 +0200
    68.3 @@ -0,0 +1,16 @@
    68.4 +var man02 = {
    68.5 +    firstName: "Pepa",
    68.6 +    secondName: "Vyskoc",
    68.7 +    address: {
    68.8 +        street: "Kolesa",
    68.9 +        city: "Kladruby"
   68.10 +    }
   68.11 +};
   68.12 +
   68.13 +
   68.14 +with (man02) {
   68.15 +    console.log(firstName);
   68.16 +    with (address) {
   68.17 +        console.log(street);
   68.18 +    }
   68.19 +}
   68.20 \ No newline at end of file
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.semantic	Tue Aug 13 14:38:34 2013 +0200
    69.3 @@ -0,0 +1,16 @@
    69.4 +var |>GLOBAL:man02<| = {
    69.5 +    |>FIELD:firstName<|: "Pepa",
    69.6 +    |>FIELD:secondName<|: "Vyskoc",
    69.7 +    |>CLASS:address<|: {
    69.8 +        |>FIELD:street<|: "Kolesa",
    69.9 +        |>FIELD:city<|: "Kladruby"
   69.10 +    }
   69.11 +};
   69.12 +
   69.13 +
   69.14 +with (|>GLOBAL:man02<|) {
   69.15 +    |>GLOBAL:console<|.log(|>FIELD:firstName<|);
   69.16 +    with (address) {
   69.17 +        |>GLOBAL:console<|.log(|>FIELD:street<|);
   69.18 +    }
   69.19 +}
   69.20 \ No newline at end of file
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.structure	Tue Aug 13 14:38:34 2013 +0200
    70.3 @@ -0,0 +1,6 @@
    70.4 +man02:CLASS:[PUBLIC]:ESCAPED{man02}:
    70.5 +  address:CLASS:[PUBLIC]:ESCAPED{address}:
    70.6 +    city:FIELD:[PUBLIC]:ESCAPED{city}<font color="#999999">ESCAPED{ : }String</font>:
    70.7 +    street:FIELD:[PUBLIC]:ESCAPED{street}<font color="#999999">ESCAPED{ : }String</font>:
    70.8 +  firstName:FIELD:[PUBLIC]:ESCAPED{firstName}<font color="#999999">ESCAPED{ : }String</font>:
    70.9 +  secondName:FIELD:[PUBLIC]:ESCAPED{secondName}<font color="#999999">ESCAPED{ : }String</font>:
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.testInner02_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    71.3 @@ -0,0 +1,2 @@
    71.4 +        |>MARK_OCCURRENCES:street<|: "Kolesa",
    71.5 +        console.log(|>MARK_OCCURRENCES:str^eet<|);
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.testInner02_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    72.3 @@ -0,0 +1,2 @@
    72.4 +    console.|>MARK_OCCURRENCES:log<|(firstName);
    72.5 +        console.|>MARK_OCCURRENCES:lo^g<|(street);
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.testInner02_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
    73.3 @@ -0,0 +1,2 @@
    73.4 +    |>MARK_OCCURRENCES:console<|.log(firstName);
    73.5 +        |>MARK_OCCURRENCES:con^sole<|.log(street);
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.testInner02_04.occurrences	Tue Aug 13 14:38:34 2013 +0200
    74.3 @@ -0,0 +1,2 @@
    74.4 +    |>MARK_OCCURRENCES:address<|: {
    74.5 +    with (|>MARK_OCCURRENCES:addr^ess<|) {
    75.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.testInner02_05.occurrences	Tue Aug 13 14:38:34 2013 +0200
    75.3 @@ -0,0 +1,2 @@
    75.4 +var |>MARK_OCCURRENCES:man02<| = {
    75.5 +with (|>MARK_OCCURRENCES:m^an02<|) {
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner02.js.testInner02_06.occurrences	Tue Aug 13 14:38:34 2013 +0200
    76.3 @@ -0,0 +1,2 @@
    76.4 +    |>MARK_OCCURRENCES:firstName<|: "Pepa",
    76.5 +    console.log(|>MARK_OCCURRENCES:firstN^ame<|);
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js	Tue Aug 13 14:38:34 2013 +0200
    77.3 @@ -0,0 +1,31 @@
    77.4 +var ondra = {
    77.5 +    name: "ondra",
    77.6 +    address: { // in ondra
    77.7 +        city: "chrudim",
    77.8 +        state: "CR"
    77.9 +    },
   77.10 +    house :{
   77.11 +      address: { // in house
   77.12 +          street: "Piseckeho"
   77.13 +      },
   77.14 +      number: 30
   77.15 +    }
   77.16 +};
   77.17 +
   77.18 + 
   77.19 +with (ondra) {
   77.20 +    console.log(address);
   77.21 +    with (address) {
   77.22 +        console.log(state);
   77.23 +    }
   77.24 +    with (house) {
   77.25 +        with(ondra) { // second
   77.26 +            with(address) { // from ondra
   77.27 +                console.log(state);
   77.28 +            } 
   77.29 +        }
   77.30 +        with(address){ // from house
   77.31 +            console.log(street);
   77.32 +        }
   77.33 +    }
   77.34 +}
   77.35 \ No newline at end of file
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.semantic	Tue Aug 13 14:38:34 2013 +0200
    78.3 @@ -0,0 +1,31 @@
    78.4 +var |>GLOBAL:ondra<| = {
    78.5 +    |>FIELD:name<|: "ondra",
    78.6 +    |>CLASS:address<|: { // in ondra
    78.7 +        |>FIELD:city<|: "chrudim",
    78.8 +        |>FIELD:state<|: "CR"
    78.9 +    },
   78.10 +    |>CLASS:house<| :{
   78.11 +      |>CLASS:address<|: { // in house
   78.12 +          |>FIELD:street<|: "Piseckeho"
   78.13 +      },
   78.14 +      |>FIELD:number<|: 30
   78.15 +    }
   78.16 +};
   78.17 +
   78.18 + 
   78.19 +with (|>GLOBAL:ondra<|) {
   78.20 +    |>GLOBAL:console<|.log(address);
   78.21 +    with (address) {
   78.22 +        |>GLOBAL:console<|.log(|>FIELD:state<|);
   78.23 +    }
   78.24 +    with (house) {
   78.25 +        with(|>GLOBAL:ondra<|) { // second
   78.26 +            with(address) { // from ondra
   78.27 +                |>GLOBAL:console<|.log(|>FIELD:state<|);
   78.28 +            } 
   78.29 +        }
   78.30 +        with(address){ // from house
   78.31 +            |>GLOBAL:console<|.log(|>FIELD:street<|);
   78.32 +        }
   78.33 +    }
   78.34 +}
   78.35 \ No newline at end of file
    79.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.structure	Tue Aug 13 14:38:34 2013 +0200
    79.3 @@ -0,0 +1,9 @@
    79.4 +ondra:CLASS:[PUBLIC]:ESCAPED{ondra}:
    79.5 +  address:CLASS:[PUBLIC]:ESCAPED{address}:
    79.6 +    city:FIELD:[PUBLIC]:ESCAPED{city}<font color="#999999">ESCAPED{ : }String</font>:
    79.7 +    state:FIELD:[PUBLIC]:ESCAPED{state}<font color="#999999">ESCAPED{ : }String</font>:
    79.8 +  house:CLASS:[PUBLIC]:ESCAPED{house}:
    79.9 +    address:CLASS:[PUBLIC]:ESCAPED{address}:
   79.10 +      street:FIELD:[PUBLIC]:ESCAPED{street}<font color="#999999">ESCAPED{ : }String</font>:
   79.11 +    number:FIELD:[PUBLIC]:ESCAPED{number}<font color="#999999">ESCAPED{ : }Number</font>:
   79.12 +  name:FIELD:[PUBLIC]:ESCAPED{name}<font color="#999999">ESCAPED{ : }String</font>:
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    80.3 @@ -0,0 +1,2 @@
    80.4 +          |>MARK_OCCURRENCES:street<|: "Piseckeho"
    80.5 +            console.log(|>MARK_OCCURRENCES:stre^et<|);
    81.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    81.3 @@ -0,0 +1,4 @@
    81.4 +    console.|>MARK_OCCURRENCES:log<|(address);
    81.5 +        console.|>MARK_OCCURRENCES:log<|(state);
    81.6 +                console.|>MARK_OCCURRENCES:log<|(state);
    81.7 +            console.|>MARK_OCCURRENCES:lo^g<|(street);
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
    82.3 @@ -0,0 +1,4 @@
    82.4 +    |>MARK_OCCURRENCES:console<|.log(address);
    82.5 +        |>MARK_OCCURRENCES:console<|.log(state);
    82.6 +                |>MARK_OCCURRENCES:console<|.log(state);
    82.7 +            |>MARK_OCCURRENCES:cons^ole<|.log(street);
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_04.occurrences	Tue Aug 13 14:38:34 2013 +0200
    83.3 @@ -0,0 +1,2 @@
    83.4 +      |>MARK_OCCURRENCES:address<|: { // in house
    83.5 +        with(|>MARK_OCCURRENCES:addre^ss<|){ // from house
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_05.occurrences	Tue Aug 13 14:38:34 2013 +0200
    84.3 @@ -0,0 +1,3 @@
    84.4 +        |>MARK_OCCURRENCES:state<|: "CR"
    84.5 +        console.log(|>MARK_OCCURRENCES:sta^te<|);
    84.6 +                console.log(|>MARK_OCCURRENCES:state<|);
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_06.occurrences	Tue Aug 13 14:38:34 2013 +0200
    85.3 @@ -0,0 +1,4 @@
    85.4 +    |>MARK_OCCURRENCES:address<|: { // in ondra
    85.5 +    console.log(|>MARK_OCCURRENCES:address<|);
    85.6 +    with (|>MARK_OCCURRENCES:address<|) {
    85.7 +            with(|>MARK_OCCURRENCES:ad^dress<|) { // from ondra
    86.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_07.occurrences	Tue Aug 13 14:38:34 2013 +0200
    86.3 @@ -0,0 +1,3 @@
    86.4 +var |>MARK_OCCURRENCES:ondra<| = {
    86.5 +with (|>MARK_OCCURRENCES:ondra<|) {
    86.6 +        with(|>MARK_OCCURRENCES:ond^ra<|) { // second
    87.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/inner03.js.testInner03_08.occurrences	Tue Aug 13 14:38:34 2013 +0200
    87.3 @@ -0,0 +1,2 @@
    87.4 +    |>MARK_OCCURRENCES:house<| :{
    87.5 +    with (|>MARK_OCCURRENCES:hou^se<|) {
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/man.js	Tue Aug 13 14:38:34 2013 +0200
    88.3 @@ -0,0 +1,25 @@
    88.4 +/**
    88.5 + * @constructor
    88.6 + * @returns {Man}
    88.7 + */
    88.8 +function Man (fName, sName) {
    88.9 +    var firstName = fName;
   88.10 +    var secondName = sName;
   88.11 +    
   88.12 +    this.getFirstName = function () {
   88.13 +        return firstName;
   88.14 +    }
   88.15 +    
   88.16 +    this.getSecondName = function () {
   88.17 +        return secondName;
   88.18 +    }
   88.19 +    
   88.20 +    this.address = {
   88.21 +        street: "unknown street",
   88.22 +        city: "some town",
   88.23 +        zip: "15000",
   88.24 +        print : function () {
   88.25 +            return "Address: " + this.street + ", " + this.city + ", " + this.zip; 
   88.26 +        }
   88.27 +    };
   88.28 +}
   88.29 \ No newline at end of file
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test01.js	Tue Aug 13 14:38:34 2013 +0200
    89.3 @@ -0,0 +1,7 @@
    89.4 +var roman = new Man("Roman", "Php");
    89.5 +
    89.6 +roman.getFirstName();
    89.7 +console.log();  
    89.8 +with(roman) {
    89.9 +   console.log(getFirstName()); 
   89.10 +}
   89.11 \ No newline at end of file
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test01.js.testWith_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
    90.3 @@ -0,0 +1,2 @@
    90.4 +roman.|>MARK_OCCURRENCES:getFirstName<|();
    90.5 +   console.log(|>MARK_OCCURRENCES:getFirst^Name<|()); 
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test01.js.testWith_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
    91.3 @@ -0,0 +1,2 @@
    91.4 +console.|>MARK_OCCURRENCES:log<|();  
    91.5 +   console.|>MARK_OCCURRENCES:l^og<|(getFirstName()); 
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test01.js.testWith_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
    92.3 @@ -0,0 +1,2 @@
    92.4 +|>MARK_OCCURRENCES:console<|.log();  
    92.5 +   |>MARK_OCCURRENCES:conso^le<|.log(getFirstName()); 
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test01.js.testWith_04.occurrences	Tue Aug 13 14:38:34 2013 +0200
    93.3 @@ -0,0 +1,3 @@
    93.4 +var |>MARK_OCCURRENCES:roman<| = new Man("Roman", "Php");
    93.5 +|>MARK_OCCURRENCES:roman<|.getFirstName();
    93.6 +with(|>MARK_OCCURRENCES:rom^an<|) {
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test02.js	Tue Aug 13 14:38:34 2013 +0200
    94.3 @@ -0,0 +1,10 @@
    94.4 +var pavel = new Man ("Petr", "Pavel");
    94.5 +  
    94.6 +with(pavel.address) {
    94.7 +    city = "Prague";
    94.8 +    street = "Piseckeho";
    94.9 +    z
   94.10 +    console.log(print());
   94.11 +}
   94.12 +pavel.address.city = "Praha";
   94.13 +console.log(pavel.address.print());
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test02.js.semantic	Tue Aug 13 14:38:34 2013 +0200
    95.3 @@ -0,0 +1,10 @@
    95.4 +var |>GLOBAL:pavel<| = new Man ("Petr", "Pavel");
    95.5 +  
    95.6 +with(|>GLOBAL:pavel<|.address) {
    95.7 +    |>FIELD:city<| = "Prague";
    95.8 +    |>FIELD:street<| = "Piseckeho";
    95.9 +    |>GLOBAL:z<|
   95.10 +    |>GLOBAL:console<|.log(print());
   95.11 +}
   95.12 +|>GLOBAL:pavel<|.address.|>FIELD:city<| = "Praha";
   95.13 +|>GLOBAL:console<|.log(|>GLOBAL:pavel<|.address.print());
   95.14 \ No newline at end of file
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test02.js.testWith_05.occurrences	Tue Aug 13 14:38:34 2013 +0200
    96.3 @@ -0,0 +1,2 @@
    96.4 +    |>MARK_OCCURRENCES:city<| = "Prague";
    96.5 +pavel.address.|>MARK_OCCURRENCES:cit^y<| = "Praha";
    97.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test02.js.testWith_06.occurrences	Tue Aug 13 14:38:34 2013 +0200
    97.3 @@ -0,0 +1,3 @@
    97.4 +with(pavel.|>MARK_OCCURRENCES:address<|) {
    97.5 +pavel.|>MARK_OCCURRENCES:addr^ess<|.city = "Praha";
    97.6 +console.log(pavel.|>MARK_OCCURRENCES:address<|.print());
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/test02.js.testWith_07.occurrences	Tue Aug 13 14:38:34 2013 +0200
    98.3 @@ -0,0 +1,4 @@
    98.4 +var |>MARK_OCCURRENCES:pavel<| = new Man ("Petr", "Pavel");
    98.5 +with(|>MARK_OCCURRENCES:pavel<|.address) {
    98.6 +|>MARK_OCCURRENCES:pav^el<|.address.city = "Praha";
    98.7 +console.log(|>MARK_OCCURRENCES:pavel<|.address.print());
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js	Tue Aug 13 14:38:34 2013 +0200
    99.3 @@ -0,0 +1,17 @@
    99.4 +var MyContext = {};
    99.5 +MyContext.okno = {
    99.6 +    truhlik: {
    99.7 +        typ: "kvetinac",
    99.8 +        kolik: 10
    99.9 +    },
   99.10 +    material:"sklo"
   99.11 +};
   99.12 +
   99.13 +
   99.14 +with (MyContext.okno) {
   99.15 +    console.log(truhlik);
   99.16 +    var myDataVarInWith = truhlik;
   99.17 +}
   99.18 +  
   99.19 +console.log(myDataVarInWith);
   99.20 +console.log(myDataVarInWith.kolik);
   100.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js.semantic	Tue Aug 13 14:38:34 2013 +0200
   100.3 @@ -0,0 +1,17 @@
   100.4 +var |>GLOBAL:MyContext<| = {};
   100.5 +|>GLOBAL:MyContext<|.|>CLASS:okno<| = {
   100.6 +    |>CLASS:truhlik<|: {
   100.7 +        |>FIELD:typ<|: "kvetinac",
   100.8 +        |>FIELD:kolik<|: 10
   100.9 +    },
  100.10 +    |>FIELD:material<|:"sklo"
  100.11 +};
  100.12 +
  100.13 +
  100.14 +with (|>GLOBAL:MyContext<|.okno) {
  100.15 +    |>GLOBAL:console<|.log(truhlik);
  100.16 +    var |>GLOBAL:myDataVarInWith<| = truhlik;
  100.17 +}
  100.18 +  
  100.19 +|>GLOBAL:console<|.log(|>GLOBAL:myDataVarInWith<|);
  100.20 +|>GLOBAL:console<|.log(|>GLOBAL:myDataVarInWith<|.kolik);
  100.21 \ No newline at end of file
   101.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js.structure	Tue Aug 13 14:38:34 2013 +0200
   101.3 @@ -0,0 +1,7 @@
   101.4 +myDataVarInWith:VARIABLE:[PUBLIC]:ESCAPED{myDataVarInWith}<font color="#999999">ESCAPED{ : }MyContext.okno@with;With$0.truhlik</font>:
   101.5 +MyContext:CLASS:[PUBLIC]:ESCAPED{MyContext}:
   101.6 +  okno:CLASS:[PUBLIC]:ESCAPED{okno}:
   101.7 +    material:FIELD:[PUBLIC]:ESCAPED{material}<font color="#999999">ESCAPED{ : }String</font>:
   101.8 +    truhlik:CLASS:[PUBLIC]:ESCAPED{truhlik}:
   101.9 +      kolik:FIELD:[PUBLIC]:ESCAPED{kolik}<font color="#999999">ESCAPED{ : }Number</font>:
  101.10 +      typ:FIELD:[PUBLIC]:ESCAPED{typ}<font color="#999999">ESCAPED{ : }String</font>:
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js.testVarInWith_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
   102.3 @@ -0,0 +1,3 @@
   102.4 +    |>MARK_OCCURRENCES:truhlik<|: {
   102.5 +    console.log(|>MARK_OCCURRENCES:truhlik<|);
   102.6 +    var myDataVarInWith = |>MARK_OCCURRENCES:truhl^ik<|;
   103.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js.testVarInWith_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
   103.3 @@ -0,0 +1,2 @@
   103.4 +MyContext.|>MARK_OCCURRENCES:okno<| = {
   103.5 +with (MyContext.|>MARK_OCCURRENCES:ok^no<|) {
   104.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js.testVarInWith_04.occurrences	Tue Aug 13 14:38:34 2013 +0200
   104.3 @@ -0,0 +1,3 @@
   104.4 +var |>MARK_OCCURRENCES:MyContext<| = {};
   104.5 +|>MARK_OCCURRENCES:MyContext<|.okno = {
   104.6 +with (|>MARK_OCCURRENCES:MyCont^ext<|.okno) {
   105.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js.testVarInWith_05.occurrences	Tue Aug 13 14:38:34 2013 +0200
   105.3 @@ -0,0 +1,3 @@
   105.4 +    var |>MARK_OCCURRENCES:myDataVarInWith<| = truhlik;
   105.5 +console.log(|>MARK_OCCURRENCES:myDataVarI^nWith<|);
   105.6 +console.log(|>MARK_OCCURRENCES:myDataVarInWith<|.kolik);
   106.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/varInWith01.js.testVarInWith_06.completion	Tue Aug 13 14:38:34 2013 +0200
   106.3 @@ -0,0 +1,6 @@
   106.4 +Code completion result for source line:
   106.5 +console.log(myDataVarInWith.|kolik);
   106.6 +(QueryType=COMPLETION, prefixSearch=true, caseSensitive=true)
   106.7 +------------------------------------
   106.8 +FIELD      kolik: Number                   [PUBLIC]   varInWith01.js
   106.9 +FIELD      typ: String                     [PUBLIC]   varInWith01.js
   107.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/woman.js	Tue Aug 13 14:38:34 2013 +0200
   107.3 @@ -0,0 +1,40 @@
   107.4 +/**
   107.5 + * @constructor
   107.6 + * @returns {Woman}
   107.7 + */
   107.8 +function Woman (fName, sName) {
   107.9 +    var firstName = fName;
  107.10 +    var secondName = sName;
  107.11 +    
  107.12 +    this.getFirstName = function () {
  107.13 +        return firstName;
  107.14 +    }
  107.15 +    
  107.16 +    this.getSecondName = function () {
  107.17 +        return secondName;
  107.18 +    }
  107.19 +    
  107.20 +    this.address = {
  107.21 +        street: "unknown street",
  107.22 +        city: "some town",
  107.23 +        zip: "15000",
  107.24 +        print : function () {
  107.25 +            return "Address: " + this.street + ", " + this.city + ", " + this.zip; 
  107.26 +        }
  107.27 +    };
  107.28 +    
  107.29 +    
  107.30 +}
  107.31 +
  107.32 +var martin = new Woman("Martin", "Chloupek");
  107.33 +
  107.34 +with(martin) {
  107.35 +    console.log(getFirstName());
  107.36 +    address.city = "Pribram";
  107.37 +    with (address) {
  107.38 +        console.log(city);
  107.39 +        city = "Podlesi";
  107.40 +    }
  107.41 +}
  107.42 +
  107.43 +console.log(martin.address.city);
   108.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/woman.js.testMarkOccurrenceWoman_01.occurrences	Tue Aug 13 14:38:34 2013 +0200
   108.3 @@ -0,0 +1,6 @@
   108.4 +        |>MARK_OCCURRENCES:city<|: "some town",
   108.5 +            return "Address: " + this.street + ", " + this.|>MARK_OCCURRENCES:city<| + ", " + this.zip; 
   108.6 +    address.|>MARK_OCCURRENCES:city<| = "Pribram";
   108.7 +        console.log(|>MARK_OCCURRENCES:city<|);
   108.8 +        |>MARK_OCCURRENCES:city<| = "Podlesi";
   108.9 +console.log(martin.address.|>MARK_OCCURRENCES:cit^y<|);
   109.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/woman.js.testMarkOccurrenceWoman_02.occurrences	Tue Aug 13 14:38:34 2013 +0200
   109.3 @@ -0,0 +1,4 @@
   109.4 +    this.|>MARK_OCCURRENCES:address<| = {
   109.5 +    |>MARK_OCCURRENCES:address<|.city = "Pribram";
   109.6 +    with (|>MARK_OCCURRENCES:address<|) {
   109.7 +console.log(martin.|>MARK_OCCURRENCES:addre^ss<|.city);
   110.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/woman.js.testMarkOccurrenceWoman_03.occurrences	Tue Aug 13 14:38:34 2013 +0200
   110.3 @@ -0,0 +1,3 @@
   110.4 +var |>MARK_OCCURRENCES:martin<| = new Woman("Martin", "Chloupek");
   110.5 +with(|>MARK_OCCURRENCES:martin<|) {
   110.6 +console.log(|>MARK_OCCURRENCES:mar^tin<|.address.city);
   111.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/woman.js.testMarkOccurrenceWoman_04.occurrences	Tue Aug 13 14:38:34 2013 +0200
   111.3 @@ -0,0 +1,3 @@
   111.4 +    console.|>MARK_OCCURRENCES:log<|(getFirstName());
   111.5 +        console.|>MARK_OCCURRENCES:log<|(city);
   111.6 +console.|>MARK_OCCURRENCES:lo^g<|(martin.address.city);
   112.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.2 +++ b/javascript2.editor/test/unit/data/testfiles/with/woman.js.testMarkOccurrenceWoman_05.occurrences	Tue Aug 13 14:38:34 2013 +0200
   112.3 @@ -0,0 +1,3 @@
   112.4 +    |>MARK_OCCURRENCES:console<|.log(getFirstName());
   112.5 +        |>MARK_OCCURRENCES:console<|.log(city);
   112.6 +|>MARK_OCCURRENCES:conso^le<|.log(martin.address.city);
   113.1 --- a/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsCodeCompletionTest.java	Tue Aug 13 14:01:33 2013 +0200
   113.2 +++ b/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsCodeCompletionTest.java	Tue Aug 13 14:38:34 2013 +0200
   113.3 @@ -239,4 +239,16 @@
   113.4      public void testIssue233719_02() throws Exception {
   113.5          checkCompletion("testfiles/structure/issue233719.js", "console.log(man.^prop2);", false);
   113.6      }
   113.7 +    
   113.8 +    public void testIssue23277() throws Exception {
   113.9 +        checkCompletion("testfiles/markoccurences/issue232792.js", "A.B.^getName();", false);
  113.10 +    }
  113.11 +    
  113.12 +    public void testCCinWith01() throws Exception {
  113.13 +        checkCompletion("testfiles/markoccurences/issue232792.js", "    ^ // try here", false);
  113.14 +    }
  113.15 +    
  113.16 +    public void testIssue232798() throws Exception {
  113.17 +        checkCompletion("testfiles/markoccurences/issue232792.js", "        this.^c // issue 232798", false);
  113.18 +    }
  113.19  }
   114.1 --- a/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsCodeCompletionWith.java	Tue Aug 13 14:01:33 2013 +0200
   114.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.3 @@ -1,91 +0,0 @@
   114.4 -/*
   114.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   114.6 - *
   114.7 - * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
   114.8 - *
   114.9 - * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  114.10 - * Other names may be trademarks of their respective owners.
  114.11 - *
  114.12 - * The contents of this file are subject to the terms of either the GNU
  114.13 - * General Public License Version 2 only ("GPL") or the Common
  114.14 - * Development and Distribution License("CDDL") (collectively, the
  114.15 - * "License"). You may not use this file except in compliance with the
  114.16 - * License. You can obtain a copy of the License at
  114.17 - * http://www.netbeans.org/cddl-gplv2.html
  114.18 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  114.19 - * specific language governing permissions and limitations under the
  114.20 - * License.  When distributing the software, include this License Header
  114.21 - * Notice in each file and include the License file at
  114.22 - * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  114.23 - * particular file as subject to the "Classpath" exception as provided
  114.24 - * by Oracle in the GPL Version 2 section of the License file that
  114.25 - * accompanied this code. If applicable, add the following below the
  114.26 - * License Header, with the fields enclosed by brackets [] replaced by
  114.27 - * your own identifying information:
  114.28 - * "Portions Copyrighted [year] [name of copyright owner]"
  114.29 - *
  114.30 - * If you wish your version of this file to be governed by only the CDDL
  114.31 - * or only the GPL Version 2, indicate your decision by adding
  114.32 - * "[Contributor] elects to include this software in this distribution
  114.33 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
  114.34 - * single choice of license, a recipient has the option to distribute
  114.35 - * your version of this file under either the CDDL, the GPL Version 2 or
  114.36 - * to extend the choice of license to its licensees as provided above.
  114.37 - * However, if you add GPL Version 2 code and therefore, elected the GPL
  114.38 - * Version 2 license, then the option applies only if the new code is
  114.39 - * made subject to such option by the copyright holder.
  114.40 - *
  114.41 - * Contributor(s):
  114.42 - *
  114.43 - * Portions Copyrighted 2012 Sun Microsystems, Inc.
  114.44 - */
  114.45 -package org.netbeans.modules.javascript2.editor;
  114.46 -
  114.47 -import java.io.File;
  114.48 -import java.util.Collections;
  114.49 -import java.util.LinkedList;
  114.50 -import java.util.List;
  114.51 -import java.util.Map;
  114.52 -import org.netbeans.api.java.classpath.ClassPath;
  114.53 -import org.netbeans.modules.javascript2.editor.classpath.ClasspathProviderImplAccessor;
  114.54 -import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  114.55 -import org.openide.filesystems.FileObject;
  114.56 -import org.openide.filesystems.FileUtil;
  114.57 -
  114.58 -/**
  114.59 - *
  114.60 - * @author Petr Hejl
  114.61 - */
  114.62 -public class JsCodeCompletionWith extends JsCodeCompletionBase {
  114.63 -    
  114.64 -    public JsCodeCompletionWith(String testName) {
  114.65 -        super(testName);
  114.66 -    }
  114.67 -    
  114.68 -    public void testWith1() throws Exception {
  114.69 -        checkCompletion("testfiles/completion/with/with1.js", "    ^ // test", false);
  114.70 -    }
  114.71 -
  114.72 -    public void testWith2() throws Exception {
  114.73 -        checkCompletion("testfiles/completion/with/with2.js", "    z.e.^", false);
  114.74 -    }
  114.75 -
  114.76 -    public void testWith3() throws Exception {
  114.77 -        checkCompletion("testfiles/completion/with/with3.js", "    ( ^ )", false);
  114.78 -    }
  114.79 -
  114.80 -    @Override
  114.81 -    protected Map<String, ClassPath> createClassPathsForTest() {
  114.82 -        List<FileObject> cpRoots = new LinkedList<FileObject>(ClasspathProviderImplAccessor.getJsStubs());
  114.83 -        cpRoots.add(FileUtil.toFileObject(new File(getDataDir(), "/testfiles/completion/with")));
  114.84 -        return Collections.singletonMap(
  114.85 -            JS_SOURCE_ID,
  114.86 -            ClassPathSupport.createClassPath(cpRoots.toArray(new FileObject[cpRoots.size()]))
  114.87 -        );
  114.88 -    }
  114.89 -
  114.90 -    @Override
  114.91 -    protected boolean classPathContainsBinaries() {
  114.92 -        return true;
  114.93 -    }
  114.94 -}
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsCodeCompletionWithTest.java	Tue Aug 13 14:38:34 2013 +0200
   115.3 @@ -0,0 +1,91 @@
   115.4 +/*
   115.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   115.6 + *
   115.7 + * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
   115.8 + *
   115.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  115.10 + * Other names may be trademarks of their respective owners.
  115.11 + *
  115.12 + * The contents of this file are subject to the terms of either the GNU
  115.13 + * General Public License Version 2 only ("GPL") or the Common
  115.14 + * Development and Distribution License("CDDL") (collectively, the
  115.15 + * "License"). You may not use this file except in compliance with the
  115.16 + * License. You can obtain a copy of the License at
  115.17 + * http://www.netbeans.org/cddl-gplv2.html
  115.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  115.19 + * specific language governing permissions and limitations under the
  115.20 + * License.  When distributing the software, include this License Header
  115.21 + * Notice in each file and include the License file at
  115.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  115.23 + * particular file as subject to the "Classpath" exception as provided
  115.24 + * by Oracle in the GPL Version 2 section of the License file that
  115.25 + * accompanied this code. If applicable, add the following below the
  115.26 + * License Header, with the fields enclosed by brackets [] replaced by
  115.27 + * your own identifying information:
  115.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  115.29 + *
  115.30 + * If you wish your version of this file to be governed by only the CDDL
  115.31 + * or only the GPL Version 2, indicate your decision by adding
  115.32 + * "[Contributor] elects to include this software in this distribution
  115.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  115.34 + * single choice of license, a recipient has the option to distribute
  115.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  115.36 + * to extend the choice of license to its licensees as provided above.
  115.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  115.38 + * Version 2 license, then the option applies only if the new code is
  115.39 + * made subject to such option by the copyright holder.
  115.40 + *
  115.41 + * Contributor(s):
  115.42 + *
  115.43 + * Portions Copyrighted 2012 Sun Microsystems, Inc.
  115.44 + */
  115.45 +package org.netbeans.modules.javascript2.editor;
  115.46 +
  115.47 +import java.io.File;
  115.48 +import java.util.Collections;
  115.49 +import java.util.LinkedList;
  115.50 +import java.util.List;
  115.51 +import java.util.Map;
  115.52 +import org.netbeans.api.java.classpath.ClassPath;
  115.53 +import org.netbeans.modules.javascript2.editor.classpath.ClasspathProviderImplAccessor;
  115.54 +import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  115.55 +import org.openide.filesystems.FileObject;
  115.56 +import org.openide.filesystems.FileUtil;
  115.57 +
  115.58 +/**
  115.59 + *
  115.60 + * @author Petr Hejl
  115.61 + */
  115.62 +public class JsCodeCompletionWithTest extends JsCodeCompletionBase {
  115.63 +    
  115.64 +    public JsCodeCompletionWithTest(String testName) {
  115.65 +        super(testName);
  115.66 +    }
  115.67 +    
  115.68 +    public void testWith1() throws Exception {
  115.69 +        checkCompletion("testfiles/completion/with/with1.js", "    ^ // test", false);
  115.70 +    }
  115.71 +
  115.72 +    public void testWith2() throws Exception {
  115.73 +        checkCompletion("testfiles/completion/with/with2.js", "    z.e.^", false);
  115.74 +    }
  115.75 +
  115.76 +    public void testWith3() throws Exception {
  115.77 +        checkCompletion("testfiles/completion/with/with3.js", "    ( ^ )", false);
  115.78 +    }
  115.79 +
  115.80 +    @Override
  115.81 +    protected Map<String, ClassPath> createClassPathsForTest() {
  115.82 +        List<FileObject> cpRoots = new LinkedList<FileObject>(ClasspathProviderImplAccessor.getJsStubs());
  115.83 +        cpRoots.add(FileUtil.toFileObject(new File(getDataDir(), "/testfiles/completion/with")));
  115.84 +        return Collections.singletonMap(
  115.85 +            JS_SOURCE_ID,
  115.86 +            ClassPathSupport.createClassPath(cpRoots.toArray(new FileObject[cpRoots.size()]))
  115.87 +        );
  115.88 +    }
  115.89 +
  115.90 +    @Override
  115.91 +    protected boolean classPathContainsBinaries() {
  115.92 +        return true;
  115.93 +    }
  115.94 +}
   116.1 --- a/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsStructureScannerTest.java	Tue Aug 13 14:01:33 2013 +0200
   116.2 +++ b/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsStructureScannerTest.java	Tue Aug 13 14:38:34 2013 +0200
   116.3 @@ -384,6 +384,14 @@
   116.4          checkStructure("testfiles/completion/issue232570.js");
   116.5      }
   116.6      
   116.7 +    public void testIssue232792() throws Exception {
   116.8 +        checkStructure("testfiles/markoccurences/issue232792.js");
   116.9 +    }
  116.10 +    
  116.11 +    public void testIssue232783() throws Exception {
  116.12 +        checkStructure("testfiles/markoccurences/issue232804.js");
  116.13 +    }
  116.14 +    
  116.15      public void testIssue231815() throws Exception {
  116.16          checkStructure("testfiles/structure/issue231815.js");
  116.17      }
   117.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.2 +++ b/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsWithBase.java	Tue Aug 13 14:38:34 2013 +0200
   117.3 @@ -0,0 +1,182 @@
   117.4 +/*
   117.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   117.6 + *
   117.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
   117.8 + *
   117.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  117.10 + * Other names may be trademarks of their respective owners.
  117.11 + *
  117.12 + * The contents of this file are subject to the terms of either the GNU
  117.13 + * General Public License Version 2 only ("GPL") or the Common
  117.14 + * Development and Distribution License("CDDL") (collectively, the
  117.15 + * "License"). You may not use this file except in compliance with the
  117.16 + * License. You can obtain a copy of the License at
  117.17 + * http://www.netbeans.org/cddl-gplv2.html
  117.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  117.19 + * specific language governing permissions and limitations under the
  117.20 + * License.  When distributing the software, include this License Header
  117.21 + * Notice in each file and include the License file at
  117.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  117.23 + * particular file as subject to the "Classpath" exception as provided
  117.24 + * by Oracle in the GPL Version 2 section of the License file that
  117.25 + * accompanied this code. If applicable, add the following below the
  117.26 + * License Header, with the fields enclosed by brackets [] replaced by
  117.27 + * your own identifying information:
  117.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  117.29 + *
  117.30 + * If you wish your version of this file to be governed by only the CDDL
  117.31 + * or only the GPL Version 2, indicate your decision by adding
  117.32 + * "[Contributor] elects to include this software in this distribution
  117.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  117.34 + * single choice of license, a recipient has the option to distribute
  117.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  117.36 + * to extend the choice of license to its licensees as provided above.
  117.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  117.38 + * Version 2 license, then the option applies only if the new code is
  117.39 + * made subject to such option by the copyright holder.
  117.40 + *
  117.41 + * Contributor(s):
  117.42 + *
  117.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
  117.44 + */
  117.45 +package org.netbeans.modules.javascript2.editor;
  117.46 +
  117.47 +import java.io.IOException;
  117.48 +import java.util.Collections;
  117.49 +import java.util.Map;
  117.50 +import java.util.Set;
  117.51 +import javax.swing.text.Document;
  117.52 +import static junit.framework.Assert.assertEquals;
  117.53 +import static junit.framework.Assert.assertNotNull;
  117.54 +import static junit.framework.Assert.assertTrue;
  117.55 +import org.netbeans.modules.csl.api.ColoringAttributes;
  117.56 +import org.netbeans.modules.csl.api.DeclarationFinder;
  117.57 +import org.netbeans.modules.csl.api.OccurrencesFinder;
  117.58 +import org.netbeans.modules.csl.api.OffsetRange;
  117.59 +import org.netbeans.modules.csl.api.SemanticAnalyzer;
  117.60 +import static org.netbeans.modules.csl.api.test.CslTestBase.getCaretOffset;
  117.61 +import org.netbeans.modules.csl.spi.GsfUtilities;
  117.62 +import org.netbeans.modules.csl.spi.ParserResult;
  117.63 +import org.netbeans.modules.javascript2.editor.parser.JsParserResult;
  117.64 +import org.netbeans.modules.parsing.api.ParserManager;
  117.65 +import org.netbeans.modules.parsing.api.ResultIterator;
  117.66 +import org.netbeans.modules.parsing.api.Source;
  117.67 +import org.netbeans.modules.parsing.api.UserTask;
  117.68 +import org.netbeans.modules.parsing.spi.Parser;
  117.69 +import org.openide.filesystems.FileObject;
  117.70 +
  117.71 +/**
  117.72 + *
  117.73 + * @author Petr Pisl
  117.74 + */
  117.75 +public class JsWithBase extends JsCodeCompletionBase{
  117.76 +
  117.77 +    public JsWithBase(String testName) {
  117.78 +        super(testName);
  117.79 +    }
  117.80 +    
  117.81 +    @Override
  117.82 +    protected DeclarationFinder.DeclarationLocation findDeclaration(String relFilePath, final String caretLine) throws Exception {
  117.83 +        Source testSource = getTestSource(getTestFile(relFilePath));
  117.84 +
  117.85 +        final int caretOffset = getCaretOffset(testSource.createSnapshot().getText().toString(), caretLine);
  117.86 +        enforceCaretOffset(testSource, caretOffset);
  117.87 +
  117.88 +        final DeclarationFinder.DeclarationLocation [] location = new DeclarationFinder.DeclarationLocation[] { null };
  117.89 +        ParserManager.parse(Collections.singleton(testSource), new UserTask() {
  117.90 +            public @Override void run(ResultIterator resultIterator) throws Exception {
  117.91 +                Parser.Result r = resultIterator.getParserResult();
  117.92 +                assertTrue(r instanceof JsParserResult);
  117.93 +                JsParserResult pr = (JsParserResult) r;
  117.94 +                pr.getModel().getGlobalObject();
  117.95 +                DeclarationFinder finder = getFinder();
  117.96 +                location[0] = finder.findDeclaration(pr, caretOffset);
  117.97 +            }
  117.98 +        });
  117.99 +
 117.100 +        return location[0];
 117.101 +    }
 117.102 +    
 117.103 +    @Override
 117.104 +    protected void assertDescriptionMatches(FileObject fileObject,
 117.105 +            String description, boolean includeTestName, String ext, boolean goldenFileInTestFileDir) throws IOException {
 117.106 +        super.assertDescriptionMatches(fileObject, description, includeTestName, ext, true);
 117.107 +    }
 117.108 +    
 117.109 +    @Override
 117.110 +    protected void checkOccurrences(String relFilePath, String caretLine, final boolean symmetric) throws Exception {
 117.111 +        Source testSource = getTestSource(getTestFile(relFilePath));
 117.112 +
 117.113 +        Document doc = testSource.getDocument(true);
 117.114 +        final int caretOffset = getCaretOffset(doc.getText(0, doc.getLength()), caretLine);
 117.115 +
 117.116 +        final OccurrencesFinder finder = getOccurrencesFinder();
 117.117 +        assertNotNull("getOccurrencesFinder must be implemented", finder);
 117.118 +        finder.setCaretPosition(caretOffset);
 117.119 +
 117.120 +        ParserManager.parse(Collections.singleton(testSource), new UserTask() {
 117.121 +            public @Override void run(ResultIterator resultIterator) throws Exception {
 117.122 +                Parser.Result r = resultIterator.getParserResult(caretOffset);
 117.123 +                if (r instanceof JsParserResult) {
 117.124 +                    ((JsParserResult)r).getModel().getGlobalObject();
 117.125 +                    finder.run((ParserResult) r, null);
 117.126 +                    Map<OffsetRange, ColoringAttributes> occurrences = finder.getOccurrences();
 117.127 +                    if (occurrences == null) {
 117.128 +                        occurrences = Collections.emptyMap();
 117.129 +                    }
 117.130 +
 117.131 +                    String annotatedSource = annotateFinderResult(resultIterator.getSnapshot(), occurrences, caretOffset);
 117.132 +                    assertDescriptionMatches(resultIterator.getSnapshot().getSource().getFileObject(), annotatedSource, true, ".occurrences");
 117.133 +
 117.134 +                    if (symmetric) {
 117.135 +                        // Extra check: Ensure that occurrences are symmetric: Placing the caret on ANY of the occurrences
 117.136 +                        // should produce the same set!!
 117.137 +                        for (OffsetRange range : occurrences.keySet()) {
 117.138 +                            int midPoint = range.getStart() + range.getLength() / 2;
 117.139 +                            finder.setCaretPosition(midPoint);
 117.140 +                            finder.run((ParserResult) r, null);
 117.141 +                            Map<OffsetRange, ColoringAttributes> alternates = finder.getOccurrences();
 117.142 +                            assertEquals("Marks differ between caret positions - failed at " + midPoint, occurrences, alternates);
 117.143 +                        }
 117.144 +                    }
 117.145 +                }
 117.146 +            }
 117.147 +        });
 117.148 +    }
 117.149 +    
 117.150 +    @Override
 117.151 +    protected void checkSemantic(final String relFilePath, final String caretLine) throws Exception {
 117.152 +        Source testSource = getTestSource(getTestFile(relFilePath));
 117.153 +
 117.154 +        if (caretLine != null) {
 117.155 +            int caretOffset = getCaretOffset(testSource.createSnapshot().getText().toString(), caretLine);
 117.156 +            enforceCaretOffset(testSource, caretOffset);
 117.157 +        }
 117.158 +
 117.159 +        ParserManager.parse(Collections.singleton(testSource), new UserTask() {
 117.160 +            public @Override void run(ResultIterator resultIterator) throws Exception {
 117.161 +                Parser.Result r = resultIterator.getParserResult();
 117.162 +                assertTrue(r instanceof ParserResult);
 117.163 +                JsParserResult pr = (JsParserResult) r;
 117.164 +                
 117.165 +                pr.getModel().getGlobalObject();
 117.166 +                
 117.167 +                SemanticAnalyzer analyzer = getSemanticAnalyzer();
 117.168 +                assertNotNull("getSemanticAnalyzer must be implemented", analyzer);
 117.169 +
 117.170 +                analyzer.run(pr, null);
 117.171 +                Map<OffsetRange, Set<ColoringAttributes>> highlights = analyzer.getHighlights();
 117.172 +
 117.173 +                if (highlights == null) {
 117.174 +                    highlights = Collections.emptyMap();
 117.175 +                }
 117.176 +
 117.177 +                Document doc = GsfUtilities.getDocument(pr.getSnapshot().getSource().getFileObject(), true);
 117.178 +                checkNoOverlaps(highlights.keySet(), doc);
 117.179 +
 117.180 +                String annotatedSource = annotateSemanticResults(doc, highlights);
 117.181 +                assertDescriptionMatches(relFilePath, annotatedSource, false, ".semantic");
 117.182 +            }
 117.183 +        });
 117.184 +    }
 117.185 +}
   118.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.2 +++ b/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsWithFastTest.java	Tue Aug 13 14:38:34 2013 +0200
   118.3 @@ -0,0 +1,228 @@
   118.4 +/*
   118.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   118.6 + *
   118.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
   118.8 + *
   118.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  118.10 + * Other names may be trademarks of their respective owners.
  118.11 + *
  118.12 + * The contents of this file are subject to the terms of either the GNU
  118.13 + * General Public License Version 2 only ("GPL") or the Common
  118.14 + * Development and Distribution License("CDDL") (collectively, the
  118.15 + * "License"). You may not use this file except in compliance with the
  118.16 + * License. You can obtain a copy of the License at
  118.17 + * http://www.netbeans.org/cddl-gplv2.html
  118.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  118.19 + * specific language governing permissions and limitations under the
  118.20 + * License.  When distributing the software, include this License Header
  118.21 + * Notice in each file and include the License file at
  118.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  118.23 + * particular file as subject to the "Classpath" exception as provided
  118.24 + * by Oracle in the GPL Version 2 section of the License file that
  118.25 + * accompanied this code. If applicable, add the following below the
  118.26 + * License Header, with the fields enclosed by brackets [] replaced by
  118.27 + * your own identifying information:
  118.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  118.29 + *
  118.30 + * If you wish your version of this file to be governed by only the CDDL
  118.31 + * or only the GPL Version 2, indicate your decision by adding
  118.32 + * "[Contributor] elects to include this software in this distribution
  118.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  118.34 + * single choice of license, a recipient has the option to distribute
  118.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  118.36 + * to extend the choice of license to its licensees as provided above.
  118.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  118.38 + * Version 2 license, then the option applies only if the new code is
  118.39 + * made subject to such option by the copyright holder.
  118.40 + *
  118.41 + * Contributor(s):
  118.42 + *
  118.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
  118.44 + */
  118.45 +package org.netbeans.modules.javascript2.editor;
  118.46 +
  118.47 +import java.util.Map;
  118.48 +import org.netbeans.api.java.classpath.ClassPath;
  118.49 +
  118.50 +/**
  118.51 + *
  118.52 + * @author Petr Pisl
  118.53 + */
  118.54 +public class JsWithFastTest extends JsWithBase {
  118.55 +    
  118.56 +    public JsWithFastTest(String testName) {
  118.57 +        super(testName);
  118.58 +    }
  118.59 +    
  118.60 +    public void testWith_01() throws Exception {
  118.61 +        checkOccurrences("testfiles/with/test01.js", "console.log(getFirst^Name());", true);
  118.62 +    }
  118.63 +    
  118.64 +    public void testWith_02() throws Exception {
  118.65 +        checkOccurrences("testfiles/with/test01.js", "console.l^og(getFirstName());", true);
  118.66 +    }
  118.67 +    
  118.68 +    public void testWith_03() throws Exception {
  118.69 +        checkOccurrences("testfiles/with/test01.js", "conso^le.log(getFirstName());", true);
  118.70 +    }
  118.71 +    
  118.72 +    public void testWith_04() throws Exception {
  118.73 +        checkOccurrences("testfiles/with/test01.js", "with(rom^an) {", true);
  118.74 +    }
  118.75 +    
  118.76 +    public void testMarkOccurrenceWoman_01() throws Exception {
  118.77 +        checkOccurrences("testfiles/with/woman.js", "console.log(martin.address.cit^y);", true);
  118.78 +    }
  118.79 +    
  118.80 +    public void testMarkOccurrenceWoman_02() throws Exception {
  118.81 +        checkOccurrences("testfiles/with/woman.js", "console.log(martin.addre^ss.city);", true);
  118.82 +    }
  118.83 +    
  118.84 +    public void testMarkOccurrenceWoman_03() throws Exception {
  118.85 +        checkOccurrences("testfiles/with/woman.js", "console.log(mar^tin.address.city);", true);
  118.86 +    }
  118.87 +    
  118.88 +    public void testMarkOccurrenceWoman_04() throws Exception {
  118.89 +        checkOccurrences("testfiles/with/woman.js", "console.lo^g(martin.address.city);", true);
  118.90 +    }
  118.91 +    
  118.92 +    public void testMarkOccurrenceWoman_05() throws Exception {
  118.93 +        checkOccurrences("testfiles/with/woman.js", "conso^le.log(martin.address.city);", true);
  118.94 +    }
  118.95 +    
  118.96 +    public void testIssue232804() throws Exception {
  118.97 +        checkSemantic("testfiles/markoccurences/issue232804.js"); 
  118.98 +    }
  118.99 +    
 118.100 +    public void testIssue232804_01() throws Exception {
 118.101 +        checkOccurrences("testfiles/markoccurences/issue232804.js","with (tes^tWith02) {", true);
 118.102 +    }
 118.103 +    
 118.104 +    public void testIssue232804_02() throws Exception {
 118.105 +        checkOccurrences("testfiles/markoccurences/issue232804.js","console.log(app.desc^ription);", true);
 118.106 +    }
 118.107 +    
 118.108 +    public void testInner01_01() throws Exception {
 118.109 +        checkOccurrences("testfiles/with/inner01.js","console.log(st^reet);", true);
 118.110 +    }
 118.111 +    
 118.112 +    public void testInner01_02() throws Exception {
 118.113 +        checkOccurrences("testfiles/with/inner01.js","console.lo^g(street);", true);
 118.114 +    }
 118.115 +    
 118.116 +    public void testInner01_03() throws Exception {
 118.117 +        checkOccurrences("testfiles/with/inner01.js","con^sole.log(street);", true);
 118.118 +    }
 118.119 +    
 118.120 +    public void testInner01_04() throws Exception {
 118.121 +        checkOccurrences("testfiles/with/inner01.js","with(addres^s01) {", true);
 118.122 +    }
 118.123 +    
 118.124 +    public void testInner01_05() throws Exception {
 118.125 +        checkOccurrences("testfiles/with/inner01.js","with (m^an01) {", true);
 118.126 +    }
 118.127 +    
 118.128 +    public void testInner01_06() throws Exception {
 118.129 +        checkOccurrences("testfiles/with/inner01.js","console.log(firstN^ame);", true);
 118.130 +    }
 118.131 +    
 118.132 +    public void testInner01() throws Exception {
 118.133 +        checkSemantic("testfiles/with/inner01.js");
 118.134 +        checkStructure("testfiles/with/inner01.js");
 118.135 +    }
 118.136 +    
 118.137 +    public void testInner01_Structure() throws Exception {
 118.138 +        checkSemantic("testfiles/with/inner01.js"); 
 118.139 +    }
 118.140 +    
 118.141 +    public void testInner02_01() throws Exception {
 118.142 +        checkOccurrences("testfiles/with/inner02.js", "console.log(str^eet);", true);
 118.143 +    }
 118.144 +    
 118.145 +    public void testInner02_02() throws Exception {
 118.146 +        checkOccurrences("testfiles/with/inner02.js","console.lo^g(street);", true);
 118.147 +    }
 118.148 +    
 118.149 +    public void testInner02_03() throws Exception {
 118.150 +        checkOccurrences("testfiles/with/inner02.js","con^sole.log(street);", true);
 118.151 +    }
 118.152 +    
 118.153 +    public void testInner02_04() throws Exception {
 118.154 +        checkOccurrences("testfiles/with/inner02.js","with (addr^ess) {", true);
 118.155 +    }
 118.156 +    
 118.157 +    public void testInner02_05() throws Exception {
 118.158 +        checkOccurrences("testfiles/with/inner02.js","with (m^an02) {", true);
 118.159 +    }
 118.160 +    
 118.161 +    public void testInner02_06() throws Exception {
 118.162 +        checkOccurrences("testfiles/with/inner02.js","console.log(firstN^ame);", true);
 118.163 +    }
 118.164 +    
 118.165 +    public void testInner02() throws Exception {
 118.166 +        checkSemantic("testfiles/with/inner02.js"); 
 118.167 +        checkStructure("testfiles/with/inner02.js");
 118.168 +    }
 118.169 +    
 118.170 +    public void testInner03() throws Exception {
 118.171 +        checkSemantic("testfiles/with/inner03.js"); 
 118.172 +        checkStructure("testfiles/with/inner03.js");
 118.173 +    }
 118.174 +    
 118.175 +    public void testInner03_01() throws Exception {
 118.176 +        checkOccurrences("testfiles/with/inner03.js", "console.log(stre^et);", true);
 118.177 +    }
 118.178 +    
 118.179 +    public void testInner03_02() throws Exception {
 118.180 +        checkOccurrences("testfiles/with/inner03.js", "console.lo^g(street);", true);
 118.181 +    }
 118.182 +    
 118.183 +    public void testInner03_03() throws Exception {
 118.184 +        checkOccurrences("testfiles/with/inner03.js", "cons^ole.log(street);", true);
 118.185 +    }
 118.186 +    
 118.187 +    public void testInner03_04() throws Exception {
 118.188 +        checkOccurrences("testfiles/with/inner03.js", "with(addre^ss){ // from house", true);
 118.189 +    }
 118.190 +    
 118.191 +    public void testInner03_05() throws Exception {
 118.192 +        checkOccurrences("testfiles/with/inner03.js", "console.log(sta^te);", true);
 118.193 +    }
 118.194 +    
 118.195 +    public void testInner03_06() throws Exception {
 118.196 +        checkOccurrences("testfiles/with/inner03.js", "with(ad^dress) { // from ondra", true);
 118.197 +    }
 118.198 +    
 118.199 +    public void testInner03_07() throws Exception {
 118.200 +        checkOccurrences("testfiles/with/inner03.js", "with(ond^ra) { // second", true);
 118.201 +    }
 118.202 +    
 118.203 +    public void testInner03_08() throws Exception {
 118.204 +        checkOccurrences("testfiles/with/inner03.js", "with (hou^se) {", true);
 118.205 +    }
 118.206 +    
 118.207 +    public void testVarInWith_01() throws Exception {
 118.208 +        checkSemantic("testfiles/with/varInWith01.js"); 
 118.209 +        checkStructure("testfiles/with/varInWith01.js");
 118.210 +    }
 118.211 +    
 118.212 +    public void testVarInWith_02() throws Exception {
 118.213 +        checkOccurrences("testfiles/with/varInWith01.js", "var myDataVarInWith = truhl^ik;", true); 
 118.214 +    }
 118.215 +    
 118.216 +    public void testVarInWith_03() throws Exception {
 118.217 +        checkOccurrences("testfiles/with/varInWith01.js", "with (MyContext.ok^no) {", true); 
 118.218 +    }
 118.219 +    
 118.220 +    public void testVarInWith_04() throws Exception {
 118.221 +        checkOccurrences("testfiles/with/varInWith01.js", "with (MyCont^ext.okno) {", true); 
 118.222 +    }
 118.223 +    
 118.224 +    public void testVarInWith_05() throws Exception {
 118.225 +        checkOccurrences("testfiles/with/varInWith01.js", "console.log(myDataVarI^nWith);", true); 
 118.226 +    }
 118.227 +    
 118.228 +    public void testVarInWith_06() throws Exception {
 118.229 +        checkCompletion("testfiles/with/varInWith01.js", "console.log(myDataVarInWith.^kolik);", true); 
 118.230 +    }
 118.231 +}
   119.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.2 +++ b/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/JsWithTest.java	Tue Aug 13 14:38:34 2013 +0200
   119.3 @@ -0,0 +1,99 @@
   119.4 +/*
   119.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   119.6 + *
   119.7 + * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
   119.8 + *
   119.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  119.10 + * Other names may be trademarks of their respective owners.
  119.11 + *
  119.12 + * The contents of this file are subject to the terms of either the GNU
  119.13 + * General Public License Version 2 only ("GPL") or the Common
  119.14 + * Development and Distribution License("CDDL") (collectively, the
  119.15 + * "License"). You may not use this file except in compliance with the
  119.16 + * License. You can obtain a copy of the License at
  119.17 + * http://www.netbeans.org/cddl-gplv2.html
  119.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  119.19 + * specific language governing permissions and limitations under the
  119.20 + * License.  When distributing the software, include this License Header
  119.21 + * Notice in each file and include the License file at
  119.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
  119.23 + * particular file as subject to the "Classpath" exception as provided
  119.24 + * by Oracle in the GPL Version 2 section of the License file that
  119.25 + * accompanied this code. If applicable, add the following below the
  119.26 + * License Header, with the fields enclosed by brackets [] replaced by
  119.27 + * your own identifying information:
  119.28 + * "Portions Copyrighted [year] [name of copyright owner]"
  119.29 + *
  119.30 + * If you wish your version of this file to be governed by only the CDDL
  119.31 + * or only the GPL Version 2, indicate your decision by adding
  119.32 + * "[Contributor] elects to include this software in this distribution
  119.33 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
  119.34 + * single choice of license, a recipient has the option to distribute
  119.35 + * your version of this file under either the CDDL, the GPL Version 2 or
  119.36 + * to extend the choice of license to its licensees as provided above.
  119.37 + * However, if you add GPL Version 2 code and therefore, elected the GPL
  119.38 + * Version 2 license, then the option applies only if the new code is
  119.39 + * made subject to such option by the copyright holder.
  119.40 + *
  119.41 + * Contributor(s):
  119.42 + *
  119.43 + * Portions Copyrighted 2013 Sun Microsystems, Inc.
  119.44 + */
  119.45 +package org.netbeans.modules.javascript2.editor;
  119.46 +
  119.47 +import java.io.File;
  119.48 +import java.util.Collections;
  119.49 +import java.util.LinkedList;
  119.50 +import java.util.List;
  119.51 +import java.util.Map;
  119.52 +import org.netbeans.api.java.classpath.ClassPath;
  119.53 +import static org.netbeans.modules.javascript2.editor.JsTestBase.JS_SOURCE_ID;
  119.54 +import org.netbeans.modules.javascript2.editor.classpath.ClasspathProviderImplAccessor;
  119.55 +import org.netbeans.spi.java.classpath.support.ClassPathSupport;
  119.56 +import org.openide.filesystems.FileObject;
  119.57 +import org.openide.filesystems.FileUtil;
  119.58 +
  119.59 +/**
  119.60 + *
  119.61 + * @author Petr Pisl
  119.62 + */
  119.63 +public class JsWithTest extends JsWithBase {
  119.64 +    
  119.65 +    public JsWithTest(String testName) {
  119.66 +        super(testName);
  119.67 +    }
  119.68 +    
  119.69 +    public void testGoTo_01() throws Exception {
  119.70 +        checkDeclaration("testfiles/with/test01.js", "console.log(getFirs^tName()); ", "man.js", 141);
  119.71 +    }
  119.72 +    
  119.73 +    public void testWith_05() throws Exception {
  119.74 +        checkOccurrences("testfiles/with/test02.js", "pavel.address.cit^y = \"Praha\";", true);
  119.75 +    }
  119.76 +    
  119.77 +    public void testWith_06() throws Exception {
  119.78 +        checkOccurrences("testfiles/with/test02.js", "pavel.addr^ess.city = \"Praha\";", true);
  119.79 +    }
  119.80 +    
  119.81 +    public void testWith_07() throws Exception {
  119.82 +        checkOccurrences("testfiles/with/test02.js", "pav^el.address.city = \"Praha\";", true);
  119.83 +    }
  119.84 +    
  119.85 +    public void testSemantic_01() throws Exception {
  119.86 +        checkSemantic("testfiles/with/test02.js");
  119.87 +    }
  119.88 +    
  119.89 +    @Override
  119.90 +    protected Map<String, ClassPath> createClassPathsForTest() {
  119.91 +        List<FileObject> cpRoots = new LinkedList<FileObject>(ClasspathProviderImplAccessor.getJsStubs());
  119.92 +        cpRoots.add(FileUtil.toFileObject(new File(getDataDir(), "/testfiles/with")));
  119.93 +        return Collections.singletonMap(
  119.94 +            JS_SOURCE_ID,
  119.95 +            ClassPathSupport.createClassPath(cpRoots.toArray(new FileObject[cpRoots.size()]))
  119.96 +        );
  119.97 +    }
  119.98 +    
  119.99 +    
 119.100 +    
 119.101 +    
 119.102 +}
   120.1 --- a/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/model/impl/MarkOccurrenceTest.java	Tue Aug 13 14:01:33 2013 +0200
   120.2 +++ b/javascript2.editor/test/unit/src/org/netbeans/modules/javascript2/editor/model/impl/MarkOccurrenceTest.java	Tue Aug 13 14:38:34 2013 +0200
   120.3 @@ -862,7 +862,7 @@
   120.4      public void testIssue217769_01() throws Exception {
   120.5          checkOccurrences("testfiles/markoccurences/issue217769.js","a.i^n();", true);
   120.6      }
   120.7 -    
   120.8 +
   120.9      public void testIssue233236_01() throws Exception {
  120.10          checkOccurrences("testfiles/markoccurences/issue233236.js","var firstName = firs^tName;", true);
  120.11      }
  120.12 @@ -895,6 +895,46 @@
  120.13          checkOccurrences("testfiles/structure/issue233738.js","var myhelp = win^dow['someprom'];", true);
  120.14      }
  120.15      
  120.16 +    
  120.17 +    // testing with statement
  120.18 +    public void testIssue232776_01() throws Exception {
  120.19 +        checkOccurrences("testfiles/markoccurences/issue232776.js","p^rop01 = prop01 + prop02;", true);
  120.20 +    }
  120.21 +    
  120.22 +    public void testIssue232776_02() throws Exception {
  120.23 +        checkOccurrences("testfiles/markoccurences/issue232776.js","prop01 = prop01 + pro^p02;", true);
  120.24 +    }
  120.25 +    
  120.26 +    public void testIssue232776_03() throws Exception {
  120.27 +        checkOccurrences("testfiles/markoccurences/issue232776.js","metho^d01();", true);
  120.28 +    }
  120.29 +    
  120.30 +    public void testIssue232776_04() throws Exception {
  120.31 +        checkOccurrences("testfiles/markoccurences/issue232776.js","with (testWi^th01) {", true);
  120.32 +    }
  120.33 +    
  120.34 +    public void testIssue232777_01() throws Exception {
  120.35 +        checkOccurrences("testfiles/markoccurences/issue232777.js","app.des^cription = \"new description\";", true);
  120.36 +    }
  120.37 +    
  120.38 +    public void testIssue232777_02() throws Exception {
  120.39 +        checkOccurrences("testfiles/markoccurences/issue232777.js","ap^p.description = \"new description\";", true);
  120.40 +    }
  120.41 +    
  120.42 +    public void testIssue232792_01() throws Exception {
  120.43 +        checkOccurrences("testfiles/markoccurences/issue232792.js","getI^nfo();", true);
  120.44 +    }
  120.45 +    
  120.46 +    public void testIssue232792_02() throws Exception {
  120.47 +        checkOccurrences("testfiles/markoccurences/issue232792.js","A.getN^ame();", true);
  120.48 +    }
  120.49 +    
  120.50 +    public void testIssue232792_03() throws Exception {
  120.51 +        checkOccurrences("testfiles/markoccurences/issue232792.js","A.B.getN^ame();", true);
  120.52 +    }
  120.53 +    
  120.54 +    
  120.55 +    
  120.56      private String getTestName() {
  120.57          String name = getName();
  120.58          int indexOf = name.indexOf("_");
   121.1 --- a/javascript2.jquery/src/org/netbeans/modules/javascript2/jquery/model/JQueryModel.java	Tue Aug 13 14:01:33 2013 +0200
   121.2 +++ b/javascript2.jquery/src/org/netbeans/modules/javascript2/jquery/model/JQueryModel.java	Tue Aug 13 14:38:34 2013 +0200
   121.3 @@ -142,11 +142,6 @@
   121.4          }
   121.5  
   121.6          @Override
   121.7 -        public List<? extends TypeUsage> getWithTypesForOffset(int offset) {
   121.8 -            return delegate.getWithTypesForOffset(offset);
   121.9 -        }
  121.10 -
  121.11 -        @Override
  121.12          public Collection<? extends JsObject> getParameters() {
  121.13              return delegate.getParameters();
  121.14          }
   122.1 --- a/parsing.api/src/org/netbeans/modules/parsing/spi/indexing/support/QuerySupport.java	Tue Aug 13 14:01:33 2013 +0200
   122.2 +++ b/parsing.api/src/org/netbeans/modules/parsing/spi/indexing/support/QuerySupport.java	Tue Aug 13 14:38:34 2013 +0200
   122.3 @@ -573,6 +573,10 @@
   122.4      private final List<URL> roots;
   122.5  
   122.6      private QuerySupport (final String indexerName, int indexerVersion, final URL... roots) throws IOException {
   122.7 +        System.out.println("QuerySupport: " + System.identityHashCode(this));
   122.8 +        for (URL url : roots) {
   122.9 +            System.out.println(url.getPath());
  122.10 +        }
  122.11          this.indexerQuery = IndexerQuery.forIndexer(indexerName, indexerVersion);
  122.12          this.roots = new LinkedList<URL>(Arrays.asList(roots));
  122.13  
  122.14 @@ -837,17 +841,19 @@
  122.15          }
  122.16  
  122.17          private LayeredDocumentIndex findIndex(URL root) {
  122.18 +            LayeredDocumentIndex res = null;
  122.19              try {
  122.20                  FileObject cacheFolder = CacheFolder.getDataFolder(root);
  122.21                  assert cacheFolder != null;
  122.22                  FileObject indexFolder = cacheFolder.getFileObject(indexerId);
  122.23                  if (indexFolder != null) {
  122.24 -                    return indexFactory.getIndex(indexFolder);
  122.25 +                    res = indexFactory.getIndex(indexFolder);
  122.26                  }
  122.27              } catch (IOException ioe) {
  122.28                  LOG.log(Level.INFO, "Can't create index for " + indexerId + " and " + root, ioe); //NOI18N
  122.29              }
  122.30 -            return null;
  122.31 +            System.out.println(root +"->"+res);
  122.32 +            return res;
  122.33          }        
  122.34      } // End of IndexerQuery class
  122.35