Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env node | 1 #!/usr/bin/env node |
| 2 // ********** Library dart:core ************** | 2 // ********** Library dart:core ************** |
| 3 // ********** Natives dart:core ************** | 3 // ********** Natives dart:core ************** |
| 4 function $throw(e) { | 4 function $throw(e) { |
| 5 // If e is not a value, we can use V8's captureStackTrace utility method. | 5 // If e is not a value, we can use V8's captureStackTrace utility method. |
| 6 // TODO(jmesserly): capture the stack trace on other JS engines. | 6 // TODO(jmesserly): capture the stack trace on other JS engines. |
| 7 if (e && (typeof e == 'object') && Error.captureStackTrace) { | 7 if (e && (typeof e == 'object') && Error.captureStackTrace) { |
| 8 // TODO(jmesserly): this will clobber the e.stack property | 8 // TODO(jmesserly): this will clobber the e.stack property |
| 9 Error.captureStackTrace(e, $throw); | 9 Error.captureStackTrace(e, $throw); |
| 10 } | 10 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 // ********** Code for Object ************** | 85 // ********** Code for Object ************** |
| 86 Object.defineProperty(Object.prototype, "get$dynamic", { value: function() { | 86 Object.defineProperty(Object.prototype, "get$dynamic", { value: function() { |
| 87 "use strict"; return this; | 87 "use strict"; return this; |
| 88 }, enumerable: false, writable: true, configurable: true }); | 88 }, enumerable: false, writable: true, configurable: true }); |
| 89 Object.defineProperty(Object.prototype, "noSuchMethod", { value: function(name, args) { | 89 Object.defineProperty(Object.prototype, "noSuchMethod", { value: function(name, args) { |
| 90 $throw(new NoSuchMethodException(this, name, args)); | 90 $throw(new NoSuchMethodException(this, name, args)); |
| 91 }, enumerable: false, writable: true, configurable: true }); | 91 }, enumerable: false, writable: true, configurable: true }); |
| 92 Object.defineProperty(Object.prototype, "_asNonSentinelEntry$0", { value: functi on() { | 92 Object.defineProperty(Object.prototype, "_asNonSentinelEntry$0", { value: functi on() { |
| 93 return this.noSuchMethod("_asNonSentinelEntry", []); | 93 return this.noSuchMethod$2("_asNonSentinelEntry", []); |
|
Jennifer Messerly
2012/01/18 00:03:00
It's weird that it's calling noSuchMethod dynamica
| |
| 94 }, enumerable: false, writable: true, configurable: true }); | 94 }, enumerable: false, writable: true, configurable: true }); |
| 95 Object.defineProperty(Object.prototype, "_checkExtends$0", { value: function() { | 95 Object.defineProperty(Object.prototype, "_checkExtends$0", { value: function() { |
| 96 return this.noSuchMethod("_checkExtends", []); | 96 return this.noSuchMethod$2("_checkExtends", []); |
| 97 }, enumerable: false, writable: true, configurable: true }); | 97 }, enumerable: false, writable: true, configurable: true }); |
| 98 Object.defineProperty(Object.prototype, "_checkNonStatic$1", { value: function($ 0) { | 98 Object.defineProperty(Object.prototype, "_checkNonStatic$1", { value: function($ 0) { |
| 99 return this.noSuchMethod("_checkNonStatic", [$0]); | 99 return this.noSuchMethod$2("_checkNonStatic", [$0]); |
| 100 }, enumerable: false, writable: true, configurable: true }); | 100 }, enumerable: false, writable: true, configurable: true }); |
| 101 Object.defineProperty(Object.prototype, "_evalConstConstructor$2", { value: func tion($0, $1) { | 101 Object.defineProperty(Object.prototype, "_evalConstConstructor$2", { value: func tion($0, $1) { |
| 102 return this.noSuchMethod("_evalConstConstructor", [$0, $1]); | 102 return this.noSuchMethod$2("_evalConstConstructor", [$0, $1]); |
| 103 }, enumerable: false, writable: true, configurable: true }); | 103 }, enumerable: false, writable: true, configurable: true }); |
| 104 Object.defineProperty(Object.prototype, "_get$3", { value: function($0, $1, $2) { | 104 Object.defineProperty(Object.prototype, "_get$3", { value: function($0, $1, $2) { |
| 105 return this.noSuchMethod("_get", [$0, $1, $2]); | 105 return this.noSuchMethod$2("_get", [$0, $1, $2]); |
| 106 }, enumerable: false, writable: true, configurable: true }); | 106 }, enumerable: false, writable: true, configurable: true }); |
| 107 Object.defineProperty(Object.prototype, "_get$3$isDynamic", { value: function($0 , $1, $2, isDynamic) { | 107 Object.defineProperty(Object.prototype, "_get$3$isDynamic", { value: function($0 , $1, $2, isDynamic) { |
| 108 return this.noSuchMethod("_get", [$0, $1, $2, isDynamic]); | 108 return this.noSuchMethod$2("_get", [$0, $1, $2, isDynamic]); |
| 109 }, enumerable: false, writable: true, configurable: true }); | 109 }, enumerable: false, writable: true, configurable: true }); |
| 110 Object.defineProperty(Object.prototype, "_get$4", { value: function($0, $1, $2, $3) { | 110 Object.defineProperty(Object.prototype, "_get$4", { value: function($0, $1, $2, $3) { |
| 111 return this.noSuchMethod("_get", [$0, $1, $2, $3]); | 111 return this.noSuchMethod$2("_get", [$0, $1, $2, $3]); |
| 112 }, enumerable: false, writable: true, configurable: true }); | 112 }, enumerable: false, writable: true, configurable: true }); |
| 113 Object.defineProperty(Object.prototype, "_pushBlock$1", { value: function($0) { | 113 Object.defineProperty(Object.prototype, "_pushBlock$1", { value: function($0) { |
| 114 return this.noSuchMethod("_pushBlock", [$0]); | 114 return this.noSuchMethod$2("_pushBlock", [$0]); |
| 115 }, enumerable: false, writable: true, configurable: true }); | |
| 116 Object.defineProperty(Object.prototype, "_set$4", { value: function($0, $1, $2, $3) { | |
| 117 return this.noSuchMethod("_set", [$0, $1, $2, $3]); | |
| 118 }, enumerable: false, writable: true, configurable: true }); | 115 }, enumerable: false, writable: true, configurable: true }); |
| 119 Object.defineProperty(Object.prototype, "_set$4$isDynamic", { value: function($0 , $1, $2, $3, isDynamic) { | 116 Object.defineProperty(Object.prototype, "_set$4$isDynamic", { value: function($0 , $1, $2, $3, isDynamic) { |
| 120 return this.noSuchMethod("_set", [$0, $1, $2, $3, isDynamic]); | 117 return this.noSuchMethod$2("_set", [$0, $1, $2, $3, isDynamic]); |
| 121 }, enumerable: false, writable: true, configurable: true }); | 118 }, enumerable: false, writable: true, configurable: true }); |
| 122 Object.defineProperty(Object.prototype, "_set$5", { value: function($0, $1, $2, $3, $4) { | 119 Object.defineProperty(Object.prototype, "_set$5", { value: function($0, $1, $2, $3, $4) { |
| 123 return this.noSuchMethod("_set", [$0, $1, $2, $3, $4]); | 120 return this.noSuchMethod$2("_set", [$0, $1, $2, $3, $4]); |
| 124 }, enumerable: false, writable: true, configurable: true }); | |
| 125 Object.defineProperty(Object.prototype, "_setindex$2", { value: function($0, $1) { | |
| 126 return this.noSuchMethod("_setindex", [$0, $1]); | |
| 127 }, enumerable: false, writable: true, configurable: true }); | 121 }, enumerable: false, writable: true, configurable: true }); |
| 128 Object.defineProperty(Object.prototype, "add$1", { value: function($0) { | 122 Object.defineProperty(Object.prototype, "add$1", { value: function($0) { |
| 129 return this.noSuchMethod("add", [$0]); | 123 return this.noSuchMethod$2("add", [$0]); |
| 130 }, enumerable: false, writable: true, configurable: true }); | 124 }, enumerable: false, writable: true, configurable: true }); |
| 131 Object.defineProperty(Object.prototype, "addAll$1", { value: function($0) { | 125 Object.defineProperty(Object.prototype, "addAll$1", { value: function($0) { |
| 132 return this.noSuchMethod("addAll", [$0]); | 126 return this.noSuchMethod$2("addAll", [$0]); |
| 133 }, enumerable: false, writable: true, configurable: true }); | 127 }, enumerable: false, writable: true, configurable: true }); |
| 134 Object.defineProperty(Object.prototype, "addDirectSubtype$1", { value: function( $0) { | 128 Object.defineProperty(Object.prototype, "addDirectSubtype$1", { value: function( $0) { |
| 135 return this.noSuchMethod("addDirectSubtype", [$0]); | 129 return this.noSuchMethod$2("addDirectSubtype", [$0]); |
| 136 }, enumerable: false, writable: true, configurable: true }); | 130 }, enumerable: false, writable: true, configurable: true }); |
| 137 Object.defineProperty(Object.prototype, "addLast$1", { value: function($0) { | 131 Object.defineProperty(Object.prototype, "addLast$1", { value: function($0) { |
| 138 return this.noSuchMethod("addLast", [$0]); | 132 return this.noSuchMethod$2("addLast", [$0]); |
| 139 }, enumerable: false, writable: true, configurable: true }); | 133 }, enumerable: false, writable: true, configurable: true }); |
| 140 Object.defineProperty(Object.prototype, "addMethod$2", { value: function($0, $1) { | 134 Object.defineProperty(Object.prototype, "addMethod$2", { value: function($0, $1) { |
| 141 return this.noSuchMethod("addMethod", [$0, $1]); | 135 return this.noSuchMethod$2("addMethod", [$0, $1]); |
| 142 }, enumerable: false, writable: true, configurable: true }); | 136 }, enumerable: false, writable: true, configurable: true }); |
| 143 Object.defineProperty(Object.prototype, "addSource$1", { value: function($0) { | 137 Object.defineProperty(Object.prototype, "addSource$1", { value: function($0) { |
| 144 return this.noSuchMethod("addSource", [$0]); | 138 return this.noSuchMethod$2("addSource", [$0]); |
| 145 }, enumerable: false, writable: true, configurable: true }); | 139 }, enumerable: false, writable: true, configurable: true }); |
| 146 Object.defineProperty(Object.prototype, "binop$4", { value: function($0, $1, $2, $3) { | 140 Object.defineProperty(Object.prototype, "binop$4", { value: function($0, $1, $2, $3) { |
| 147 return this.noSuchMethod("binop", [$0, $1, $2, $3]); | 141 return this.noSuchMethod$2("binop", [$0, $1, $2, $3]); |
| 148 }, enumerable: false, writable: true, configurable: true }); | 142 }, enumerable: false, writable: true, configurable: true }); |
| 149 Object.defineProperty(Object.prototype, "block$0", { value: function() { | 143 Object.defineProperty(Object.prototype, "block$0", { value: function() { |
| 150 return this.noSuchMethod("block", []); | 144 return this.noSuchMethod$2("block", []); |
| 151 }, enumerable: false, writable: true, configurable: true }); | 145 }, enumerable: false, writable: true, configurable: true }); |
| 152 Object.defineProperty(Object.prototype, "canInvoke$2", { value: function($0, $1) { | 146 Object.defineProperty(Object.prototype, "canInvoke$2", { value: function($0, $1) { |
| 153 return this.noSuchMethod("canInvoke", [$0, $1]); | 147 return this.noSuchMethod$2("canInvoke", [$0, $1]); |
| 154 }, enumerable: false, writable: true, configurable: true }); | 148 }, enumerable: false, writable: true, configurable: true }); |
| 155 Object.defineProperty(Object.prototype, "checkFirstClass$1", { value: function($ 0) { | 149 Object.defineProperty(Object.prototype, "checkFirstClass$1", { value: function($ 0) { |
| 156 return this.noSuchMethod("checkFirstClass", [$0]); | 150 return this.noSuchMethod$2("checkFirstClass", [$0]); |
| 157 }, enumerable: false, writable: true, configurable: true }); | 151 }, enumerable: false, writable: true, configurable: true }); |
| 158 Object.defineProperty(Object.prototype, "compareTo$1", { value: function($0) { | 152 Object.defineProperty(Object.prototype, "compareTo$1", { value: function($0) { |
| 159 return this.noSuchMethod("compareTo", [$0]); | 153 return this.noSuchMethod$2("compareTo", [$0]); |
| 160 }, enumerable: false, writable: true, configurable: true }); | 154 }, enumerable: false, writable: true, configurable: true }); |
| 161 Object.defineProperty(Object.prototype, "compilationUnit$0", { value: function() { | 155 Object.defineProperty(Object.prototype, "compilationUnit$0", { value: function() { |
| 162 return this.noSuchMethod("compilationUnit", []); | 156 return this.noSuchMethod$2("compilationUnit", []); |
| 163 }, enumerable: false, writable: true, configurable: true }); | 157 }, enumerable: false, writable: true, configurable: true }); |
| 164 Object.defineProperty(Object.prototype, "computeValue$0", { value: function() { | 158 Object.defineProperty(Object.prototype, "computeValue$0", { value: function() { |
| 165 return this.noSuchMethod("computeValue", []); | 159 return this.noSuchMethod$2("computeValue", []); |
| 166 }, enumerable: false, writable: true, configurable: true }); | 160 }, enumerable: false, writable: true, configurable: true }); |
| 167 Object.defineProperty(Object.prototype, "contains$1", { value: function($0) { | 161 Object.defineProperty(Object.prototype, "contains$1", { value: function($0) { |
| 168 return this.noSuchMethod("contains", [$0]); | 162 return this.noSuchMethod$2("contains", [$0]); |
| 169 }, enumerable: false, writable: true, configurable: true }); | 163 }, enumerable: false, writable: true, configurable: true }); |
| 170 Object.defineProperty(Object.prototype, "containsKey$1", { value: function($0) { | 164 Object.defineProperty(Object.prototype, "containsKey$1", { value: function($0) { |
| 171 return this.noSuchMethod("containsKey", [$0]); | 165 return this.noSuchMethod$2("containsKey", [$0]); |
| 172 }, enumerable: false, writable: true, configurable: true }); | 166 }, enumerable: false, writable: true, configurable: true }); |
| 173 Object.defineProperty(Object.prototype, "convertTo$2", { value: function($0, $1) { | 167 Object.defineProperty(Object.prototype, "convertTo$2", { value: function($0, $1) { |
| 174 return this.noSuchMethod("convertTo", [$0, $1]); | 168 return this.noSuchMethod$2("convertTo", [$0, $1]); |
| 175 }, enumerable: false, writable: true, configurable: true }); | 169 }, enumerable: false, writable: true, configurable: true }); |
| 176 Object.defineProperty(Object.prototype, "convertTo$3", { value: function($0, $1, $2) { | 170 Object.defineProperty(Object.prototype, "convertTo$3", { value: function($0, $1, $2) { |
| 177 return this.noSuchMethod("convertTo", [$0, $1, $2]); | 171 return this.noSuchMethod$2("convertTo", [$0, $1, $2]); |
| 178 }, enumerable: false, writable: true, configurable: true }); | 172 }, enumerable: false, writable: true, configurable: true }); |
| 179 Object.defineProperty(Object.prototype, "copyWithNewType$2", { value: function($ 0, $1) { | 173 Object.defineProperty(Object.prototype, "copyWithNewType$2", { value: function($ 0, $1) { |
| 180 return this.noSuchMethod("copyWithNewType", [$0, $1]); | 174 return this.noSuchMethod$2("copyWithNewType", [$0, $1]); |
| 181 }, enumerable: false, writable: true, configurable: true }); | 175 }, enumerable: false, writable: true, configurable: true }); |
| 182 Object.defineProperty(Object.prototype, "create$3$isFinal", { value: function($0 , $1, $2, isFinal) { | 176 Object.defineProperty(Object.prototype, "create$3$isFinal", { value: function($0 , $1, $2, isFinal) { |
| 183 return this.noSuchMethod("create", [$0, $1, $2, isFinal]); | 177 return this.noSuchMethod$2("create", [$0, $1, $2, isFinal]); |
| 184 }, enumerable: false, writable: true, configurable: true }); | 178 }, enumerable: false, writable: true, configurable: true }); |
| 185 Object.defineProperty(Object.prototype, "elapsedInMs$0", { value: function() { | 179 Object.defineProperty(Object.prototype, "elapsedInMs$0", { value: function() { |
| 186 return this.noSuchMethod("elapsedInMs", []); | 180 return this.noSuchMethod$2("elapsedInMs", []); |
| 187 }, enumerable: false, writable: true, configurable: true }); | 181 }, enumerable: false, writable: true, configurable: true }); |
| 188 Object.defineProperty(Object.prototype, "end$0", { value: function() { | 182 Object.defineProperty(Object.prototype, "end$0", { value: function() { |
| 189 return this.noSuchMethod("end", []); | 183 return this.noSuchMethod$2("end", []); |
| 190 }, enumerable: false, writable: true, configurable: true }); | 184 }, enumerable: false, writable: true, configurable: true }); |
| 191 Object.defineProperty(Object.prototype, "endsWith$1", { value: function($0) { | 185 Object.defineProperty(Object.prototype, "endsWith$1", { value: function($0) { |
| 192 return this.noSuchMethod("endsWith", [$0]); | 186 return this.noSuchMethod$2("endsWith", [$0]); |
| 193 }, enumerable: false, writable: true, configurable: true }); | 187 }, enumerable: false, writable: true, configurable: true }); |
| 194 Object.defineProperty(Object.prototype, "ensureSubtypeOf$3", { value: function($ 0, $1, $2) { | 188 Object.defineProperty(Object.prototype, "ensureSubtypeOf$3", { value: function($ 0, $1, $2) { |
| 195 return this.noSuchMethod("ensureSubtypeOf", [$0, $1, $2]); | 189 return this.noSuchMethod$2("ensureSubtypeOf", [$0, $1, $2]); |
| 196 }, enumerable: false, writable: true, configurable: true }); | 190 }, enumerable: false, writable: true, configurable: true }); |
| 197 Object.defineProperty(Object.prototype, "evalBody$2", { value: function($0, $1) { | 191 Object.defineProperty(Object.prototype, "evalBody$2", { value: function($0, $1) { |
| 198 return this.noSuchMethod("evalBody", [$0, $1]); | 192 return this.noSuchMethod$2("evalBody", [$0, $1]); |
| 199 }, enumerable: false, writable: true, configurable: true }); | |
| 200 Object.defineProperty(Object.prototype, "every$1", { value: function($0) { | |
| 201 return this.noSuchMethod("every", [$0]); | |
| 202 }, enumerable: false, writable: true, configurable: true }); | 193 }, enumerable: false, writable: true, configurable: true }); |
| 203 Object.defineProperty(Object.prototype, "filter$1", { value: function($0) { | 194 Object.defineProperty(Object.prototype, "filter$1", { value: function($0) { |
| 204 return this.noSuchMethod("filter", [$0]); | 195 return this.noSuchMethod$2("filter", [$0]); |
| 205 }, enumerable: false, writable: true, configurable: true }); | 196 }, enumerable: false, writable: true, configurable: true }); |
| 206 Object.defineProperty(Object.prototype, "findTypeByName$1", { value: function($0 ) { | 197 Object.defineProperty(Object.prototype, "findTypeByName$1", { value: function($0 ) { |
| 207 return this.noSuchMethod("findTypeByName", [$0]); | 198 return this.noSuchMethod$2("findTypeByName", [$0]); |
| 208 }, enumerable: false, writable: true, configurable: true }); | 199 }, enumerable: false, writable: true, configurable: true }); |
| 209 Object.defineProperty(Object.prototype, "forEach$1", { value: function($0) { | 200 Object.defineProperty(Object.prototype, "forEach$1", { value: function($0) { |
| 210 return this.noSuchMethod("forEach", [$0]); | 201 return this.noSuchMethod$2("forEach", [$0]); |
| 211 }, enumerable: false, writable: true, configurable: true }); | 202 }, enumerable: false, writable: true, configurable: true }); |
| 212 Object.defineProperty(Object.prototype, "genValue$2", { value: function($0, $1) { | 203 Object.defineProperty(Object.prototype, "genValue$2", { value: function($0, $1) { |
| 213 return this.noSuchMethod("genValue", [$0, $1]); | 204 return this.noSuchMethod$2("genValue", [$0, $1]); |
| 214 }, enumerable: false, writable: true, configurable: true }); | 205 }, enumerable: false, writable: true, configurable: true }); |
| 215 Object.defineProperty(Object.prototype, "generate$1", { value: function($0) { | 206 Object.defineProperty(Object.prototype, "generate$1", { value: function($0) { |
| 216 return this.noSuchMethod("generate", [$0]); | 207 return this.noSuchMethod$2("generate", [$0]); |
| 217 }, enumerable: false, writable: true, configurable: true }); | 208 }, enumerable: false, writable: true, configurable: true }); |
| 218 Object.defineProperty(Object.prototype, "getColumn$2", { value: function($0, $1) { | 209 Object.defineProperty(Object.prototype, "getColumn$2", { value: function($0, $1) { |
| 219 return this.noSuchMethod("getColumn", [$0, $1]); | 210 return this.noSuchMethod$2("getColumn", [$0, $1]); |
| 220 }, enumerable: false, writable: true, configurable: true }); | 211 }, enumerable: false, writable: true, configurable: true }); |
| 221 Object.defineProperty(Object.prototype, "getConstructor$1", { value: function($0 ) { | 212 Object.defineProperty(Object.prototype, "getConstructor$1", { value: function($0 ) { |
| 222 return this.noSuchMethod("getConstructor", [$0]); | 213 return this.noSuchMethod$2("getConstructor", [$0]); |
| 223 }, enumerable: false, writable: true, configurable: true }); | 214 }, enumerable: false, writable: true, configurable: true }); |
| 224 Object.defineProperty(Object.prototype, "getFactory$2", { value: function($0, $1 ) { | 215 Object.defineProperty(Object.prototype, "getFactory$2", { value: function($0, $1 ) { |
| 225 return this.noSuchMethod("getFactory", [$0, $1]); | 216 return this.noSuchMethod$2("getFactory", [$0, $1]); |
| 226 }, enumerable: false, writable: true, configurable: true }); | 217 }, enumerable: false, writable: true, configurable: true }); |
| 227 Object.defineProperty(Object.prototype, "getGlobalValue$0", { value: function() { | 218 Object.defineProperty(Object.prototype, "getGlobalValue$0", { value: function() { |
| 228 return this.noSuchMethod("getGlobalValue", []); | 219 return this.noSuchMethod$2("getGlobalValue", []); |
| 229 }, enumerable: false, writable: true, configurable: true }); | 220 }, enumerable: false, writable: true, configurable: true }); |
| 230 Object.defineProperty(Object.prototype, "getKeys$0", { value: function() { | 221 Object.defineProperty(Object.prototype, "getKeys$0", { value: function() { |
| 231 return this.noSuchMethod("getKeys", []); | 222 return this.noSuchMethod$2("getKeys", []); |
| 232 }, enumerable: false, writable: true, configurable: true }); | 223 }, enumerable: false, writable: true, configurable: true }); |
| 233 Object.defineProperty(Object.prototype, "getLine$1", { value: function($0) { | 224 Object.defineProperty(Object.prototype, "getLine$1", { value: function($0) { |
| 234 return this.noSuchMethod("getLine", [$0]); | 225 return this.noSuchMethod$2("getLine", [$0]); |
| 235 }, enumerable: false, writable: true, configurable: true }); | 226 }, enumerable: false, writable: true, configurable: true }); |
| 236 Object.defineProperty(Object.prototype, "getMember$1", { value: function($0) { | 227 Object.defineProperty(Object.prototype, "getMember$1", { value: function($0) { |
| 237 return this.noSuchMethod("getMember", [$0]); | 228 return this.noSuchMethod$2("getMember", [$0]); |
| 238 }, enumerable: false, writable: true, configurable: true }); | 229 }, enumerable: false, writable: true, configurable: true }); |
| 239 Object.defineProperty(Object.prototype, "getOrMakeConcreteType$1", { value: func tion($0) { | 230 Object.defineProperty(Object.prototype, "getOrMakeConcreteType$1", { value: func tion($0) { |
| 240 return this.noSuchMethod("getOrMakeConcreteType", [$0]); | 231 return this.noSuchMethod$2("getOrMakeConcreteType", [$0]); |
| 241 }, enumerable: false, writable: true, configurable: true }); | |
| 242 Object.defineProperty(Object.prototype, "getRange$2", { value: function($0, $1) { | |
| 243 return this.noSuchMethod("getRange", [$0, $1]); | |
| 244 }, enumerable: false, writable: true, configurable: true }); | 232 }, enumerable: false, writable: true, configurable: true }); |
| 245 Object.defineProperty(Object.prototype, "getValues$0", { value: function() { | 233 Object.defineProperty(Object.prototype, "getValues$0", { value: function() { |
| 246 return this.noSuchMethod("getValues", []); | 234 return this.noSuchMethod$2("getValues", []); |
| 247 }, enumerable: false, writable: true, configurable: true }); | 235 }, enumerable: false, writable: true, configurable: true }); |
| 248 Object.defineProperty(Object.prototype, "get_$3", { value: function($0, $1, $2) { | 236 Object.defineProperty(Object.prototype, "get_$3", { value: function($0, $1, $2) { |
| 249 return this.noSuchMethod("get_", [$0, $1, $2]); | 237 return this.noSuchMethod$2("get_", [$0, $1, $2]); |
| 250 }, enumerable: false, writable: true, configurable: true }); | 238 }, enumerable: false, writable: true, configurable: true }); |
| 251 Object.defineProperty(Object.prototype, "hasNext$0", { value: function() { | 239 Object.defineProperty(Object.prototype, "hasNext$0", { value: function() { |
| 252 return this.noSuchMethod("hasNext", []); | 240 return this.noSuchMethod$2("hasNext", []); |
| 253 }, enumerable: false, writable: true, configurable: true }); | 241 }, enumerable: false, writable: true, configurable: true }); |
| 254 Object.defineProperty(Object.prototype, "hashCode$0", { value: function() { | 242 Object.defineProperty(Object.prototype, "hashCode$0", { value: function() { |
| 255 return this.noSuchMethod("hashCode", []); | 243 return this.noSuchMethod$2("hashCode", []); |
| 256 }, enumerable: false, writable: true, configurable: true }); | 244 }, enumerable: false, writable: true, configurable: true }); |
| 257 Object.defineProperty(Object.prototype, "indexOf$1", { value: function($0) { | 245 Object.defineProperty(Object.prototype, "indexOf$1", { value: function($0) { |
| 258 return this.noSuchMethod("indexOf", [$0]); | 246 return this.noSuchMethod$2("indexOf", [$0]); |
| 259 }, enumerable: false, writable: true, configurable: true }); | 247 }, enumerable: false, writable: true, configurable: true }); |
| 260 Object.defineProperty(Object.prototype, "initFields$0", { value: function() { | 248 Object.defineProperty(Object.prototype, "initFields$0", { value: function() { |
| 261 return this.noSuchMethod("initFields", []); | 249 return this.noSuchMethod$2("initFields", []); |
| 262 }, enumerable: false, writable: true, configurable: true }); | 250 }, enumerable: false, writable: true, configurable: true }); |
| 263 Object.defineProperty(Object.prototype, "instanceOf$3$isTrue$forceCheck", { valu e: function($0, $1, $2, isTrue, forceCheck) { | 251 Object.defineProperty(Object.prototype, "instanceOf$3$isTrue$forceCheck", { valu e: function($0, $1, $2, isTrue, forceCheck) { |
| 264 return this.noSuchMethod("instanceOf", [$0, $1, $2, isTrue, forceCheck]); | 252 return this.noSuchMethod$2("instanceOf", [$0, $1, $2, isTrue, forceCheck]); |
| 265 }, enumerable: false, writable: true, configurable: true }); | 253 }, enumerable: false, writable: true, configurable: true }); |
| 266 Object.defineProperty(Object.prototype, "instanceOf$4", { value: function($0, $1 , $2, $3) { | 254 Object.defineProperty(Object.prototype, "instanceOf$4", { value: function($0, $1 , $2, $3) { |
| 267 return this.noSuchMethod("instanceOf", [$0, $1, $2, $3]); | 255 return this.noSuchMethod$2("instanceOf", [$0, $1, $2, $3]); |
| 268 }, enumerable: false, writable: true, configurable: true }); | 256 }, enumerable: false, writable: true, configurable: true }); |
| 269 Object.defineProperty(Object.prototype, "invoke$4", { value: function($0, $1, $2 , $3) { | 257 Object.defineProperty(Object.prototype, "invoke$4", { value: function($0, $1, $2 , $3) { |
| 270 return this.noSuchMethod("invoke", [$0, $1, $2, $3]); | 258 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3]); |
| 271 }, enumerable: false, writable: true, configurable: true }); | 259 }, enumerable: false, writable: true, configurable: true }); |
| 272 Object.defineProperty(Object.prototype, "invoke$4$isDynamic", { value: function( $0, $1, $2, $3, isDynamic) { | 260 Object.defineProperty(Object.prototype, "invoke$4$isDynamic", { value: function( $0, $1, $2, $3, isDynamic) { |
| 273 return this.noSuchMethod("invoke", [$0, $1, $2, $3, isDynamic]); | 261 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3, isDynamic]); |
| 274 }, enumerable: false, writable: true, configurable: true }); | 262 }, enumerable: false, writable: true, configurable: true }); |
| 275 Object.defineProperty(Object.prototype, "invoke$5", { value: function($0, $1, $2 , $3, $4) { | 263 Object.defineProperty(Object.prototype, "invoke$5", { value: function($0, $1, $2 , $3, $4) { |
| 276 return this.noSuchMethod("invoke", [$0, $1, $2, $3, $4]); | 264 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3, $4]); |
| 277 }, enumerable: false, writable: true, configurable: true }); | 265 }, enumerable: false, writable: true, configurable: true }); |
| 278 Object.defineProperty(Object.prototype, "invokeNoSuchMethod$4", { value: functio n($0, $1, $2, $3) { | 266 Object.defineProperty(Object.prototype, "invokeNoSuchMethod$4", { value: functio n($0, $1, $2, $3) { |
| 279 return this.noSuchMethod("invokeNoSuchMethod", [$0, $1, $2, $3]); | 267 return this.noSuchMethod$2("invokeNoSuchMethod", [$0, $1, $2, $3]); |
| 280 }, enumerable: false, writable: true, configurable: true }); | 268 }, enumerable: false, writable: true, configurable: true }); |
| 281 Object.defineProperty(Object.prototype, "is$List", { value: function() { | 269 Object.defineProperty(Object.prototype, "is$List", { value: function() { |
| 282 return false; | 270 return false; |
| 283 }, enumerable: false, writable: true, configurable: true }); | 271 }, enumerable: false, writable: true, configurable: true }); |
| 284 Object.defineProperty(Object.prototype, "is$RegExp", { value: function() { | 272 Object.defineProperty(Object.prototype, "is$RegExp", { value: function() { |
| 285 return false; | 273 return false; |
| 286 }, enumerable: false, writable: true, configurable: true }); | 274 }, enumerable: false, writable: true, configurable: true }); |
| 287 Object.defineProperty(Object.prototype, "isAssignable$1", { value: function($0) { | 275 Object.defineProperty(Object.prototype, "isAssignable$1", { value: function($0) { |
| 288 return this.noSuchMethod("isAssignable", [$0]); | 276 return this.noSuchMethod$2("isAssignable", [$0]); |
| 289 }, enumerable: false, writable: true, configurable: true }); | 277 }, enumerable: false, writable: true, configurable: true }); |
| 290 Object.defineProperty(Object.prototype, "isEmpty$0", { value: function() { | 278 Object.defineProperty(Object.prototype, "isEmpty$0", { value: function() { |
| 291 return this.noSuchMethod("isEmpty", []); | 279 return this.noSuchMethod$2("isEmpty", []); |
| 292 }, enumerable: false, writable: true, configurable: true }); | 280 }, enumerable: false, writable: true, configurable: true }); |
| 293 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) { | 281 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) { |
| 294 return this.noSuchMethod("isSubtypeOf", [$0]); | 282 return this.noSuchMethod$2("isSubtypeOf", [$0]); |
| 295 }, enumerable: false, writable: true, configurable: true }); | 283 }, enumerable: false, writable: true, configurable: true }); |
| 296 Object.defineProperty(Object.prototype, "iterator$0", { value: function() { | 284 Object.defineProperty(Object.prototype, "iterator$0", { value: function() { |
| 297 return this.noSuchMethod("iterator", []); | 285 return this.noSuchMethod$2("iterator", []); |
| 298 }, enumerable: false, writable: true, configurable: true }); | 286 }, enumerable: false, writable: true, configurable: true }); |
| 299 Object.defineProperty(Object.prototype, "last$0", { value: function() { | 287 Object.defineProperty(Object.prototype, "last$0", { value: function() { |
| 300 return this.noSuchMethod("last", []); | 288 return this.noSuchMethod$2("last", []); |
| 301 }, enumerable: false, writable: true, configurable: true }); | 289 }, enumerable: false, writable: true, configurable: true }); |
| 302 Object.defineProperty(Object.prototype, "lookup$2", { value: function($0, $1) { | 290 Object.defineProperty(Object.prototype, "lookup$2", { value: function($0, $1) { |
| 303 return this.noSuchMethod("lookup", [$0, $1]); | 291 return this.noSuchMethod$2("lookup", [$0, $1]); |
| 304 }, enumerable: false, writable: true, configurable: true }); | 292 }, enumerable: false, writable: true, configurable: true }); |
| 305 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() { | 293 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() { |
| 306 return this.noSuchMethod("markUsed", []); | 294 return this.noSuchMethod$2("markUsed", []); |
| 307 }, enumerable: false, writable: true, configurable: true }); | 295 }, enumerable: false, writable: true, configurable: true }); |
| 308 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0) { | 296 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0) { |
| 309 return this.noSuchMethod("namesInOrder", [$0]); | 297 return this.noSuchMethod$2("namesInOrder", [$0]); |
| 310 }, enumerable: false, writable: true, configurable: true }); | 298 }, enumerable: false, writable: true, configurable: true }); |
| 311 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($ 0) { | 299 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($ 0) { |
| 312 return this.noSuchMethod("needsConversion", [$0]); | 300 return this.noSuchMethod$2("needsConversion", [$0]); |
| 313 }, enumerable: false, writable: true, configurable: true }); | 301 }, enumerable: false, writable: true, configurable: true }); |
| 314 Object.defineProperty(Object.prototype, "next$0", { value: function() { | 302 Object.defineProperty(Object.prototype, "next$0", { value: function() { |
| 315 return this.noSuchMethod("next", []); | 303 return this.noSuchMethod$2("next", []); |
| 304 }, enumerable: false, writable: true, configurable: true }); | |
| 305 Object.defineProperty(Object.prototype, "noSuchMethod$2", { value: function($0, $1) { | |
| 306 return this.noSuchMethod($0, $1); | |
| 316 }, enumerable: false, writable: true, configurable: true }); | 307 }, enumerable: false, writable: true, configurable: true }); |
| 317 Object.defineProperty(Object.prototype, "postResolveChecks$0", { value: function () { | 308 Object.defineProperty(Object.prototype, "postResolveChecks$0", { value: function () { |
| 318 return this.noSuchMethod("postResolveChecks", []); | 309 return this.noSuchMethod$2("postResolveChecks", []); |
| 319 }, enumerable: false, writable: true, configurable: true }); | 310 }, enumerable: false, writable: true, configurable: true }); |
| 320 Object.defineProperty(Object.prototype, "provideFieldSyntax$0", { value: functio n() { | 311 Object.defineProperty(Object.prototype, "provideFieldSyntax$0", { value: functio n() { |
| 321 return this.noSuchMethod("provideFieldSyntax", []); | 312 return this.noSuchMethod$2("provideFieldSyntax", []); |
| 322 }, enumerable: false, writable: true, configurable: true }); | 313 }, enumerable: false, writable: true, configurable: true }); |
| 323 Object.defineProperty(Object.prototype, "providePropertySyntax$0", { value: func tion() { | 314 Object.defineProperty(Object.prototype, "providePropertySyntax$0", { value: func tion() { |
| 324 return this.noSuchMethod("providePropertySyntax", []); | 315 return this.noSuchMethod$2("providePropertySyntax", []); |
| 325 }, enumerable: false, writable: true, configurable: true }); | |
| 326 Object.defineProperty(Object.prototype, "putIfAbsent$2", { value: function($0, $ 1) { | |
| 327 return this.noSuchMethod("putIfAbsent", [$0, $1]); | |
| 328 }, enumerable: false, writable: true, configurable: true }); | |
| 329 Object.defineProperty(Object.prototype, "removeFirst$0", { value: function() { | |
| 330 return this.noSuchMethod("removeFirst", []); | |
| 331 }, enumerable: false, writable: true, configurable: true }); | 316 }, enumerable: false, writable: true, configurable: true }); |
| 332 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { | 317 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { |
| 333 return this.noSuchMethod("removeLast", []); | 318 return this.noSuchMethod$2("removeLast", []); |
| 334 }, enumerable: false, writable: true, configurable: true }); | 319 }, enumerable: false, writable: true, configurable: true }); |
| 335 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0, $1) { | 320 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0, $1) { |
| 336 return this.noSuchMethod("replaceFirst", [$0, $1]); | 321 return this.noSuchMethod$2("replaceFirst", [$0, $1]); |
| 337 }, enumerable: false, writable: true, configurable: true }); | 322 }, enumerable: false, writable: true, configurable: true }); |
| 338 Object.defineProperty(Object.prototype, "replaceValue$1", { value: function($0) { | 323 Object.defineProperty(Object.prototype, "replaceValue$1", { value: function($0) { |
| 339 return this.noSuchMethod("replaceValue", [$0]); | 324 return this.noSuchMethod$2("replaceValue", [$0]); |
| 340 }, enumerable: false, writable: true, configurable: true }); | 325 }, enumerable: false, writable: true, configurable: true }); |
| 341 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { | 326 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { |
| 342 return this.noSuchMethod("resolve", []); | 327 return this.noSuchMethod$2("resolve", []); |
| 343 }, enumerable: false, writable: true, configurable: true }); | 328 }, enumerable: false, writable: true, configurable: true }); |
| 344 Object.defineProperty(Object.prototype, "resolveType$2", { value: function($0, $ 1) { | 329 Object.defineProperty(Object.prototype, "resolveType$2", { value: function($0, $ 1) { |
| 345 return this.noSuchMethod("resolveType", [$0, $1]); | 330 return this.noSuchMethod$2("resolveType", [$0, $1]); |
| 346 }, enumerable: false, writable: true, configurable: true }); | 331 }, enumerable: false, writable: true, configurable: true }); |
| 347 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function ($0) { | 332 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function ($0) { |
| 348 return this.noSuchMethod("resolveTypeParams", [$0]); | 333 return this.noSuchMethod$2("resolveTypeParams", [$0]); |
| 349 }, enumerable: false, writable: true, configurable: true }); | 334 }, enumerable: false, writable: true, configurable: true }); |
| 350 Object.defineProperty(Object.prototype, "run$0", { value: function() { | 335 Object.defineProperty(Object.prototype, "run$0", { value: function() { |
| 351 return this.noSuchMethod("run", []); | 336 return this.noSuchMethod$2("run", []); |
| 352 }, enumerable: false, writable: true, configurable: true }); | 337 }, enumerable: false, writable: true, configurable: true }); |
| 353 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0) { | 338 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0) { |
| 354 return this.noSuchMethod("setDefinition", [$0]); | 339 return this.noSuchMethod$2("setDefinition", [$0]); |
| 355 }, enumerable: false, writable: true, configurable: true }); | 340 }, enumerable: false, writable: true, configurable: true }); |
| 356 Object.defineProperty(Object.prototype, "set_$4", { value: function($0, $1, $2, $3) { | 341 Object.defineProperty(Object.prototype, "setIndex$4$kind$returnKind", { value: f unction($0, $1, $2, $3, kind, returnKind) { |
| 357 return this.noSuchMethod("set_", [$0, $1, $2, $3]); | 342 return this.noSuchMethod$2("setIndex", [$0, $1, $2, $3, kind, returnKind]); |
| 358 }, enumerable: false, writable: true, configurable: true }); | 343 }, enumerable: false, writable: true, configurable: true }); |
| 359 Object.defineProperty(Object.prototype, "some$1", { value: function($0) { | 344 Object.defineProperty(Object.prototype, "set_$4$kind$returnKind", { value: funct ion($0, $1, $2, $3, kind, returnKind) { |
| 360 return this.noSuchMethod("some", [$0]); | 345 return this.noSuchMethod$2("set_", [$0, $1, $2, $3, kind, returnKind]); |
| 361 }, enumerable: false, writable: true, configurable: true }); | 346 }, enumerable: false, writable: true, configurable: true }); |
| 362 Object.defineProperty(Object.prototype, "sort$1", { value: function($0) { | 347 Object.defineProperty(Object.prototype, "sort$1", { value: function($0) { |
| 363 return this.noSuchMethod("sort", [$0]); | 348 return this.noSuchMethod$2("sort", [$0]); |
| 364 }, enumerable: false, writable: true, configurable: true }); | 349 }, enumerable: false, writable: true, configurable: true }); |
| 365 Object.defineProperty(Object.prototype, "start$0", { value: function() { | 350 Object.defineProperty(Object.prototype, "start$0", { value: function() { |
| 366 return this.noSuchMethod("start", []); | 351 return this.noSuchMethod$2("start", []); |
| 367 }, enumerable: false, writable: true, configurable: true }); | 352 }, enumerable: false, writable: true, configurable: true }); |
| 368 Object.defineProperty(Object.prototype, "startsWith$1", { value: function($0) { | 353 Object.defineProperty(Object.prototype, "startsWith$1", { value: function($0) { |
| 369 return this.noSuchMethod("startsWith", [$0]); | 354 return this.noSuchMethod$2("startsWith", [$0]); |
| 370 }, enumerable: false, writable: true, configurable: true }); | 355 }, enumerable: false, writable: true, configurable: true }); |
| 371 Object.defineProperty(Object.prototype, "stop$0", { value: function() { | 356 Object.defineProperty(Object.prototype, "stop$0", { value: function() { |
| 372 return this.noSuchMethod("stop", []); | 357 return this.noSuchMethod$2("stop", []); |
| 373 }, enumerable: false, writable: true, configurable: true }); | 358 }, enumerable: false, writable: true, configurable: true }); |
| 374 Object.defineProperty(Object.prototype, "substring$1", { value: function($0) { | 359 Object.defineProperty(Object.prototype, "substring$1", { value: function($0) { |
| 375 return this.noSuchMethod("substring", [$0]); | 360 return this.noSuchMethod$2("substring", [$0]); |
| 376 }, enumerable: false, writable: true, configurable: true }); | 361 }, enumerable: false, writable: true, configurable: true }); |
| 377 Object.defineProperty(Object.prototype, "substring$2", { value: function($0, $1) { | 362 Object.defineProperty(Object.prototype, "substring$2", { value: function($0, $1) { |
| 378 return this.noSuchMethod("substring", [$0, $1]); | 363 return this.noSuchMethod$2("substring", [$0, $1]); |
| 379 }, enumerable: false, writable: true, configurable: true }); | 364 }, enumerable: false, writable: true, configurable: true }); |
| 380 Object.defineProperty(Object.prototype, "toRadixString$1", { value: function($0) { | 365 Object.defineProperty(Object.prototype, "toRadixString$1", { value: function($0) { |
| 381 return this.noSuchMethod("toRadixString", [$0]); | 366 return this.noSuchMethod$2("toRadixString", [$0]); |
| 382 }, enumerable: false, writable: true, configurable: true }); | 367 }, enumerable: false, writable: true, configurable: true }); |
| 383 Object.defineProperty(Object.prototype, "toString$0", { value: function() { | 368 Object.defineProperty(Object.prototype, "toString$0", { value: function() { |
| 384 return this.toString(); | 369 return this.toString(); |
| 385 }, enumerable: false, writable: true, configurable: true }); | 370 }, enumerable: false, writable: true, configurable: true }); |
| 386 Object.defineProperty(Object.prototype, "unop$3", { value: function($0, $1, $2) { | 371 Object.defineProperty(Object.prototype, "unop$3", { value: function($0, $1, $2) { |
| 387 return this.noSuchMethod("unop", [$0, $1, $2]); | 372 return this.noSuchMethod$2("unop", [$0, $1, $2]); |
| 388 }, enumerable: false, writable: true, configurable: true }); | 373 }, enumerable: false, writable: true, configurable: true }); |
| 389 Object.defineProperty(Object.prototype, "visit$1", { value: function($0) { | 374 Object.defineProperty(Object.prototype, "visit$1", { value: function($0) { |
| 390 return this.noSuchMethod("visit", [$0]); | 375 return this.noSuchMethod$2("visit", [$0]); |
| 376 }, enumerable: false, writable: true, configurable: true }); | |
| 377 Object.defineProperty(Object.prototype, "visitAssertStatement$1", { value: funct ion($0) { | |
| 378 return this.noSuchMethod$2("visitAssertStatement", [$0]); | |
| 391 }, enumerable: false, writable: true, configurable: true }); | 379 }, enumerable: false, writable: true, configurable: true }); |
| 392 Object.defineProperty(Object.prototype, "visitBinaryExpression$1", { value: func tion($0) { | 380 Object.defineProperty(Object.prototype, "visitBinaryExpression$1", { value: func tion($0) { |
| 393 return this.noSuchMethod("visitBinaryExpression", [$0]); | 381 return this.noSuchMethod$2("visitBinaryExpression", [$0]); |
| 382 }, enumerable: false, writable: true, configurable: true }); | |
| 383 Object.defineProperty(Object.prototype, "visitBlockStatement$1", { value: functi on($0) { | |
| 384 return this.noSuchMethod$2("visitBlockStatement", [$0]); | |
| 385 }, enumerable: false, writable: true, configurable: true }); | |
| 386 Object.defineProperty(Object.prototype, "visitBreakStatement$1", { value: functi on($0) { | |
| 387 return this.noSuchMethod$2("visitBreakStatement", [$0]); | |
| 388 }, enumerable: false, writable: true, configurable: true }); | |
| 389 Object.defineProperty(Object.prototype, "visitContinueStatement$1", { value: fun ction($0) { | |
| 390 return this.noSuchMethod$2("visitContinueStatement", [$0]); | |
| 391 }, enumerable: false, writable: true, configurable: true }); | |
| 392 Object.defineProperty(Object.prototype, "visitDeclaredIdentifier$1", { value: fu nction($0) { | |
| 393 return this.noSuchMethod$2("visitDeclaredIdentifier", [$0]); | |
| 394 }, enumerable: false, writable: true, configurable: true }); | |
| 395 Object.defineProperty(Object.prototype, "visitDietStatement$1", { value: functio n($0) { | |
| 396 return this.noSuchMethod$2("visitDietStatement", [$0]); | |
| 397 }, enumerable: false, writable: true, configurable: true }); | |
| 398 Object.defineProperty(Object.prototype, "visitDoStatement$1", { value: function( $0) { | |
| 399 return this.noSuchMethod$2("visitDoStatement", [$0]); | |
| 400 }, enumerable: false, writable: true, configurable: true }); | |
| 401 Object.defineProperty(Object.prototype, "visitEmptyStatement$1", { value: functi on($0) { | |
| 402 return this.noSuchMethod$2("visitEmptyStatement", [$0]); | |
| 403 }, enumerable: false, writable: true, configurable: true }); | |
| 404 Object.defineProperty(Object.prototype, "visitExpressionStatement$1", { value: f unction($0) { | |
| 405 return this.noSuchMethod$2("visitExpressionStatement", [$0]); | |
| 406 }, enumerable: false, writable: true, configurable: true }); | |
| 407 Object.defineProperty(Object.prototype, "visitForInStatement$1", { value: functi on($0) { | |
| 408 return this.noSuchMethod$2("visitForInStatement", [$0]); | |
| 409 }, enumerable: false, writable: true, configurable: true }); | |
| 410 Object.defineProperty(Object.prototype, "visitForStatement$1", { value: function ($0) { | |
| 411 return this.noSuchMethod$2("visitForStatement", [$0]); | |
| 412 }, enumerable: false, writable: true, configurable: true }); | |
| 413 Object.defineProperty(Object.prototype, "visitFunctionDefinition$1", { value: fu nction($0) { | |
| 414 return this.noSuchMethod$2("visitFunctionDefinition", [$0]); | |
| 415 }, enumerable: false, writable: true, configurable: true }); | |
| 416 Object.defineProperty(Object.prototype, "visitIfStatement$1", { value: function( $0) { | |
| 417 return this.noSuchMethod$2("visitIfStatement", [$0]); | |
| 418 }, enumerable: false, writable: true, configurable: true }); | |
| 419 Object.defineProperty(Object.prototype, "visitIndexExpression$1", { value: funct ion($0) { | |
| 420 return this.noSuchMethod$2("visitIndexExpression", [$0]); | |
| 421 }, enumerable: false, writable: true, configurable: true }); | |
| 422 Object.defineProperty(Object.prototype, "visitLabeledStatement$1", { value: func tion($0) { | |
| 423 return this.noSuchMethod$2("visitLabeledStatement", [$0]); | |
| 424 }, enumerable: false, writable: true, configurable: true }); | |
| 425 Object.defineProperty(Object.prototype, "visitLambdaExpression$1", { value: func tion($0) { | |
| 426 return this.noSuchMethod$2("visitLambdaExpression", [$0]); | |
| 427 }, enumerable: false, writable: true, configurable: true }); | |
| 428 Object.defineProperty(Object.prototype, "visitLiteralExpression$1", { value: fun ction($0) { | |
| 429 return this.noSuchMethod$2("visitLiteralExpression", [$0]); | |
| 430 }, enumerable: false, writable: true, configurable: true }); | |
| 431 Object.defineProperty(Object.prototype, "visitMapExpression$1", { value: functio n($0) { | |
| 432 return this.noSuchMethod$2("visitMapExpression", [$0]); | |
| 433 }, enumerable: false, writable: true, configurable: true }); | |
| 434 Object.defineProperty(Object.prototype, "visitNewExpression$1", { value: functio n($0) { | |
| 435 return this.noSuchMethod$2("visitNewExpression", [$0]); | |
| 394 }, enumerable: false, writable: true, configurable: true }); | 436 }, enumerable: false, writable: true, configurable: true }); |
| 395 Object.defineProperty(Object.prototype, "visitPostfixExpression$1", { value: fun ction($0) { | 437 Object.defineProperty(Object.prototype, "visitPostfixExpression$1", { value: fun ction($0) { |
| 396 return this.noSuchMethod("visitPostfixExpression", [$0]); | 438 return this.noSuchMethod$2("visitPostfixExpression", [$0]); |
| 439 }, enumerable: false, writable: true, configurable: true }); | |
| 440 Object.defineProperty(Object.prototype, "visitReturnStatement$1", { value: funct ion($0) { | |
| 441 return this.noSuchMethod$2("visitReturnStatement", [$0]); | |
| 397 }, enumerable: false, writable: true, configurable: true }); | 442 }, enumerable: false, writable: true, configurable: true }); |
| 398 Object.defineProperty(Object.prototype, "visitSources$0", { value: function() { | 443 Object.defineProperty(Object.prototype, "visitSources$0", { value: function() { |
| 399 return this.noSuchMethod("visitSources", []); | 444 return this.noSuchMethod$2("visitSources", []); |
| 445 }, enumerable: false, writable: true, configurable: true }); | |
| 446 Object.defineProperty(Object.prototype, "visitSwitchStatement$1", { value: funct ion($0) { | |
| 447 return this.noSuchMethod$2("visitSwitchStatement", [$0]); | |
| 448 }, enumerable: false, writable: true, configurable: true }); | |
| 449 Object.defineProperty(Object.prototype, "visitThrowStatement$1", { value: functi on($0) { | |
| 450 return this.noSuchMethod$2("visitThrowStatement", [$0]); | |
| 451 }, enumerable: false, writable: true, configurable: true }); | |
| 452 Object.defineProperty(Object.prototype, "visitTryStatement$1", { value: function ($0) { | |
| 453 return this.noSuchMethod$2("visitTryStatement", [$0]); | |
| 454 }, enumerable: false, writable: true, configurable: true }); | |
| 455 Object.defineProperty(Object.prototype, "visitVariableDefinition$1", { value: fu nction($0) { | |
| 456 return this.noSuchMethod$2("visitVariableDefinition", [$0]); | |
| 457 }, enumerable: false, writable: true, configurable: true }); | |
| 458 Object.defineProperty(Object.prototype, "visitWhileStatement$1", { value: functi on($0) { | |
| 459 return this.noSuchMethod$2("visitWhileStatement", [$0]); | |
| 400 }, enumerable: false, writable: true, configurable: true }); | 460 }, enumerable: false, writable: true, configurable: true }); |
| 401 Object.defineProperty(Object.prototype, "write$1", { value: function($0) { | 461 Object.defineProperty(Object.prototype, "write$1", { value: function($0) { |
| 402 return this.noSuchMethod("write", [$0]); | 462 return this.noSuchMethod$2("write", [$0]); |
| 403 }, enumerable: false, writable: true, configurable: true }); | 463 }, enumerable: false, writable: true, configurable: true }); |
| 404 Object.defineProperty(Object.prototype, "writeDefinition$2", { value: function($ 0, $1) { | 464 Object.defineProperty(Object.prototype, "writeDefinition$2", { value: function($ 0, $1) { |
| 405 return this.noSuchMethod("writeDefinition", [$0, $1]); | 465 return this.noSuchMethod$2("writeDefinition", [$0, $1]); |
| 406 }, enumerable: false, writable: true, configurable: true }); | 466 }, enumerable: false, writable: true, configurable: true }); |
| 407 // ********** Code for Clock ************** | 467 // ********** Code for Clock ************** |
| 408 function Clock() {} | 468 function Clock() {} |
| 409 Clock.now = function() { | 469 Clock.now = function() { |
| 410 return new Date().getTime(); | 470 return new Date().getTime(); |
| 411 } | 471 } |
| 412 Clock.frequency = function() { | 472 Clock.frequency = function() { |
| 413 return (1000); | 473 return (1000); |
| 414 } | 474 } |
| 415 // ********** Code for IllegalAccessException ************** | 475 // ********** Code for IllegalAccessException ************** |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 426 this._functionName = _functionName; | 486 this._functionName = _functionName; |
| 427 this._arguments = _arguments; | 487 this._arguments = _arguments; |
| 428 } | 488 } |
| 429 NoSuchMethodException.prototype.toString = function() { | 489 NoSuchMethodException.prototype.toString = function() { |
| 430 var sb = new StringBufferImpl(""); | 490 var sb = new StringBufferImpl(""); |
| 431 for (var i = (0); | 491 for (var i = (0); |
| 432 i < this._arguments.get$length(); i++) { | 492 i < this._arguments.get$length(); i++) { |
| 433 if (i > (0)) { | 493 if (i > (0)) { |
| 434 sb.add(", "); | 494 sb.add(", "); |
| 435 } | 495 } |
| 436 sb.add(this._arguments.$index(i)); | 496 sb.add(this._arguments[i]); |
| 437 } | 497 } |
| 438 sb.add("]"); | 498 sb.add("]"); |
| 439 return ("NoSuchMethodException - receiver: '" + this._receiver + "' ") + ("fun ction name: '" + this._functionName + "' arguments: [" + sb + "]"); | 499 return ("NoSuchMethodException - receiver: '" + this._receiver + "' ") + ("fun ction name: '" + this._functionName + "' arguments: [" + sb + "]"); |
| 440 } | 500 } |
| 441 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS tring; | 501 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS tring; |
| 442 // ********** Code for ClosureArgumentMismatchException ************** | 502 // ********** Code for ClosureArgumentMismatchException ************** |
| 443 function ClosureArgumentMismatchException() { | 503 function ClosureArgumentMismatchException() { |
| 444 | 504 |
| 445 } | 505 } |
| 446 ClosureArgumentMismatchException.prototype.toString = function() { | 506 ClosureArgumentMismatchException.prototype.toString = function() { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 }, enumerable: false, writable: true, configurable: true }); | 716 }, enumerable: false, writable: true, configurable: true }); |
| 657 Object.defineProperty(ListFactory.prototype, "isEmpty", { value: function() { | 717 Object.defineProperty(ListFactory.prototype, "isEmpty", { value: function() { |
| 658 return this.get$length() == (0); | 718 return this.get$length() == (0); |
| 659 }, enumerable: false, writable: true, configurable: true }); | 719 }, enumerable: false, writable: true, configurable: true }); |
| 660 Object.defineProperty(ListFactory.prototype, "iterator", { value: function() { | 720 Object.defineProperty(ListFactory.prototype, "iterator", { value: function() { |
| 661 return new ListIterator(this); | 721 return new ListIterator(this); |
| 662 }, enumerable: false, writable: true, configurable: true }); | 722 }, enumerable: false, writable: true, configurable: true }); |
| 663 Object.defineProperty(ListFactory.prototype, "add$1", { value: ListFactory.proto type.add, enumerable: false, writable: true, configurable: true }); | 723 Object.defineProperty(ListFactory.prototype, "add$1", { value: ListFactory.proto type.add, enumerable: false, writable: true, configurable: true }); |
| 664 Object.defineProperty(ListFactory.prototype, "addAll$1", { value: ListFactory.pr ototype.addAll, enumerable: false, writable: true, configurable: true }); | 724 Object.defineProperty(ListFactory.prototype, "addAll$1", { value: ListFactory.pr ototype.addAll, enumerable: false, writable: true, configurable: true }); |
| 665 Object.defineProperty(ListFactory.prototype, "addLast$1", { value: ListFactory.p rototype.addLast, enumerable: false, writable: true, configurable: true }); | 725 Object.defineProperty(ListFactory.prototype, "addLast$1", { value: ListFactory.p rototype.addLast, enumerable: false, writable: true, configurable: true }); |
| 666 Object.defineProperty(ListFactory.prototype, "every$1", { value: function($0) { | |
| 667 return this.every(to$call$1($0)); | |
| 668 }, enumerable: false, writable: true, configurable: true }); | |
| 669 Object.defineProperty(ListFactory.prototype, "filter$1", { value: function($0) { | 726 Object.defineProperty(ListFactory.prototype, "filter$1", { value: function($0) { |
| 670 return this.filter(to$call$1($0)); | 727 return this.filter(to$call$1($0)); |
| 671 }, enumerable: false, writable: true, configurable: true }); | 728 }, enumerable: false, writable: true, configurable: true }); |
| 672 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0) { | 729 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0) { |
| 673 return this.forEach(to$call$1($0)); | 730 return this.forEach(to$call$1($0)); |
| 674 }, enumerable: false, writable: true, configurable: true }); | 731 }, enumerable: false, writable: true, configurable: true }); |
| 675 Object.defineProperty(ListFactory.prototype, "getRange$2", { value: ListFactory. prototype.getRange, enumerable: false, writable: true, configurable: true }); | |
| 676 Object.defineProperty(ListFactory.prototype, "indexOf$1", { value: ListFactory.p rototype.indexOf, enumerable: false, writable: true, configurable: true }); | 732 Object.defineProperty(ListFactory.prototype, "indexOf$1", { value: ListFactory.p rototype.indexOf, enumerable: false, writable: true, configurable: true }); |
| 677 Object.defineProperty(ListFactory.prototype, "isEmpty$0", { value: ListFactory.p rototype.isEmpty, enumerable: false, writable: true, configurable: true }); | 733 Object.defineProperty(ListFactory.prototype, "isEmpty$0", { value: ListFactory.p rototype.isEmpty, enumerable: false, writable: true, configurable: true }); |
| 678 Object.defineProperty(ListFactory.prototype, "iterator$0", { value: ListFactory. prototype.iterator, enumerable: false, writable: true, configurable: true }); | 734 Object.defineProperty(ListFactory.prototype, "iterator$0", { value: ListFactory. prototype.iterator, enumerable: false, writable: true, configurable: true }); |
| 679 Object.defineProperty(ListFactory.prototype, "last$0", { value: ListFactory.prot otype.last, enumerable: false, writable: true, configurable: true }); | 735 Object.defineProperty(ListFactory.prototype, "last$0", { value: ListFactory.prot otype.last, enumerable: false, writable: true, configurable: true }); |
| 680 Object.defineProperty(ListFactory.prototype, "removeLast$0", { value: ListFactor y.prototype.removeLast, enumerable: false, writable: true, configurable: true }) ; | 736 Object.defineProperty(ListFactory.prototype, "removeLast$0", { value: ListFactor y.prototype.removeLast, enumerable: false, writable: true, configurable: true }) ; |
| 681 Object.defineProperty(ListFactory.prototype, "some$1", { value: function($0) { | |
| 682 return this.some(to$call$1($0)); | |
| 683 }, enumerable: false, writable: true, configurable: true }); | |
| 684 Object.defineProperty(ListFactory.prototype, "sort$1", { value: function($0) { | 737 Object.defineProperty(ListFactory.prototype, "sort$1", { value: function($0) { |
| 685 return this.sort(to$call$2($0)); | 738 return this.sort(to$call$2($0)); |
| 686 }, enumerable: false, writable: true, configurable: true }); | 739 }, enumerable: false, writable: true, configurable: true }); |
| 687 ListFactory_E = ListFactory; | 740 ListFactory_E = ListFactory; |
| 688 ListFactory_Expression = ListFactory; | 741 ListFactory_Expression = ListFactory; |
| 689 ListFactory_K = ListFactory; | 742 ListFactory_K = ListFactory; |
| 690 ListFactory_dart_core_String = ListFactory; | 743 ListFactory_dart_core_String = ListFactory; |
| 691 ListFactory_V = ListFactory; | 744 ListFactory_V = ListFactory; |
| 692 ListFactory_VariableValue = ListFactory; | 745 ListFactory_VariableValue = ListFactory; |
| 693 ListFactory_int = ListFactory; | 746 ListFactory_int = ListFactory; |
| 694 // ********** Code for ListIterator ************** | 747 // ********** Code for ListIterator ************** |
| 695 function ListIterator(array) { | 748 function ListIterator(array) { |
| 696 this._array = array; | 749 this._array = array; |
| 697 this._pos = (0); | 750 this._pos = (0); |
| 698 } | 751 } |
| 699 ListIterator.prototype.hasNext = function() { | 752 ListIterator.prototype.hasNext = function() { |
| 700 return this._array.get$length() > this._pos; | 753 return this._array.get$length() > this._pos; |
| 701 } | 754 } |
| 702 ListIterator.prototype.next = function() { | 755 ListIterator.prototype.next = function() { |
| 703 if (!this.hasNext()) { | 756 if (!this.hasNext()) { |
| 704 $throw(const$0005); | 757 $throw(const$0005); |
| 705 } | 758 } |
| 706 return this._array.$index(this._pos++); | 759 return this._array[this._pos++]; |
| 707 } | 760 } |
| 708 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; | 761 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; |
| 709 ListIterator.prototype.next$0 = ListIterator.prototype.next; | 762 ListIterator.prototype.next$0 = ListIterator.prototype.next; |
| 710 // ********** Code for ImmutableList ************** | 763 // ********** Code for ImmutableList ************** |
| 711 /** Implements extends for Dart classes on JavaScript prototypes. */ | 764 /** Implements extends for Dart classes on JavaScript prototypes. */ |
| 712 function $inherits(child, parent) { | 765 function $inherits(child, parent) { |
| 713 if (child.prototype.__proto__) { | 766 if (child.prototype.__proto__) { |
| 714 child.prototype.__proto__ = parent.prototype; | 767 child.prototype.__proto__ = parent.prototype; |
| 715 } else { | 768 } else { |
| 716 function tmp() {}; | 769 function tmp() {}; |
| 717 tmp.prototype = parent.prototype; | 770 tmp.prototype = parent.prototype; |
| 718 child.prototype = new tmp(); | 771 child.prototype = new tmp(); |
| 719 child.prototype.constructor = child; | 772 child.prototype.constructor = child; |
| 720 } | 773 } |
| 721 } | 774 } |
| 722 $inherits(ImmutableList, ListFactory_E); | 775 $inherits(ImmutableList, ListFactory_E); |
| 723 function ImmutableList(length) { | 776 function ImmutableList(length) { |
| 724 this._length = length; | |
| 725 Array.call(this, length); | 777 Array.call(this, length); |
| 726 } | 778 } |
| 727 ImmutableList.ImmutableList$from$factory = function(other) { | 779 ImmutableList.ImmutableList$from$factory = function(other) { |
| 728 var list = new ImmutableList(other.get$length()); | 780 return _constList(other); |
| 729 for (var i = (0); | |
| 730 i < other.get$length(); i++) { | |
| 731 list._setindex$2(i, other.$index(i)); | |
| 732 } | |
| 733 return list; | |
| 734 } | 781 } |
| 735 ImmutableList.prototype.get$length = function() { | 782 ImmutableList.prototype.get$length = function() { |
| 736 return this._length; | 783 return this.length; |
| 737 } | 784 } |
| 738 ImmutableList.prototype.set$length = function(length) { | 785 ImmutableList.prototype.set$length = function(length) { |
| 739 $throw(const$0007); | 786 $throw(const$0007); |
| 740 } | 787 } |
| 741 Object.defineProperty(ImmutableList.prototype, "length", { | |
| 742 get: ImmutableList.prototype.get$length, | |
| 743 set: ImmutableList.prototype.set$length | |
| 744 }); | |
| 745 ImmutableList.prototype._setindex = function(index, value) { | |
| 746 return this[index] = value; | |
| 747 } | |
| 748 ImmutableList.prototype.$setindex = function(index, value) { | 788 ImmutableList.prototype.$setindex = function(index, value) { |
| 749 $throw(const$0007); | 789 $throw(const$0007); |
| 750 } | 790 } |
| 751 ImmutableList.prototype.sort = function(compare) { | 791 ImmutableList.prototype.sort = function(compare) { |
| 752 $throw(const$0007); | 792 $throw(const$0007); |
| 753 } | 793 } |
| 754 ImmutableList.prototype.add = function(element) { | 794 ImmutableList.prototype.add = function(element) { |
| 755 $throw(const$0007); | 795 $throw(const$0007); |
| 756 } | 796 } |
| 757 ImmutableList.prototype.addLast = function(element) { | 797 ImmutableList.prototype.addLast = function(element) { |
| 758 $throw(const$0007); | 798 $throw(const$0007); |
| 759 } | 799 } |
| 760 ImmutableList.prototype.addAll = function(elements) { | 800 ImmutableList.prototype.addAll = function(elements) { |
| 761 $throw(const$0007); | 801 $throw(const$0007); |
| 762 } | 802 } |
| 763 ImmutableList.prototype.clear = function() { | 803 ImmutableList.prototype.clear = function() { |
| 764 $throw(const$0007); | 804 $throw(const$0007); |
| 765 } | 805 } |
| 766 ImmutableList.prototype.removeLast = function() { | 806 ImmutableList.prototype.removeLast = function() { |
| 767 $throw(const$0007); | 807 $throw(const$0007); |
| 768 } | 808 } |
| 769 ImmutableList.prototype.toString = function() { | 809 ImmutableList.prototype.toString = function() { |
| 770 return ListFactory.ListFactory$from$factory(this).toString(); | 810 return ListFactory.ListFactory$from$factory(this).toString$0(); |
| 771 } | 811 } |
| 772 ImmutableList.prototype._setindex$2 = ImmutableList.prototype._setindex; | |
| 773 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; | 812 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; |
| 774 ImmutableList.prototype.addAll$1 = ImmutableList.prototype.addAll; | 813 ImmutableList.prototype.addAll$1 = ImmutableList.prototype.addAll; |
| 775 ImmutableList.prototype.addLast$1 = ImmutableList.prototype.addLast; | 814 ImmutableList.prototype.addLast$1 = ImmutableList.prototype.addLast; |
| 776 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; | 815 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; |
| 777 ImmutableList.prototype.sort$1 = function($0) { | 816 ImmutableList.prototype.sort$1 = function($0) { |
| 778 return this.sort(to$call$2($0)); | 817 return this.sort(to$call$2($0)); |
| 779 }; | 818 }; |
| 780 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString; | 819 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString; |
| 781 // ********** Code for NumImplementation ************** | 820 // ********** Code for NumImplementation ************** |
| 782 NumImplementation = Number; | 821 NumImplementation = Number; |
| 822 NumImplementation.prototype.$negate = function() { | |
| 823 'use strict'; return -this; | |
| 824 } | |
| 783 NumImplementation.prototype.isNaN = function() { | 825 NumImplementation.prototype.isNaN = function() { |
| 784 'use strict'; return isNaN(this); | 826 'use strict'; return isNaN(this); |
| 785 } | 827 } |
| 786 NumImplementation.prototype.isNegative = function() { | 828 NumImplementation.prototype.isNegative = function() { |
| 787 'use strict'; return this == 0 ? (1 / this) < 0 : this < 0; | 829 'use strict'; return this == 0 ? (1 / this) < 0 : this < 0; |
| 788 } | 830 } |
| 789 NumImplementation.prototype.hashCode = function() { | 831 NumImplementation.prototype.hashCode = function() { |
| 790 'use strict'; return this & 0x1FFFFFFF; | 832 'use strict'; return this & 0x1FFFFFFF; |
| 791 } | 833 } |
| 792 NumImplementation.prototype.toDouble = function() { | 834 NumImplementation.prototype.toDouble = function() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 850 } | 892 } |
| 851 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length ) { | 893 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length ) { |
| 852 return (currentProbe + numberOfProbes) & (length - (1)); | 894 return (currentProbe + numberOfProbes) & (length - (1)); |
| 853 } | 895 } |
| 854 HashMapImplementation.prototype._probeForAdding = function(key) { | 896 HashMapImplementation.prototype._probeForAdding = function(key) { |
| 855 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); | 897 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); |
| 856 var numberOfProbes = (1); | 898 var numberOfProbes = (1); |
| 857 var initialHash = hash; | 899 var initialHash = hash; |
| 858 var insertionIndex = (-1); | 900 var insertionIndex = (-1); |
| 859 while (true) { | 901 while (true) { |
| 860 var existingKey = this._keys.$index(hash); | 902 var existingKey = this._keys[hash]; |
| 861 if (existingKey == null) { | 903 if (existingKey == null) { |
| 862 if (insertionIndex < (0)) return hash; | 904 if (insertionIndex < (0)) return hash; |
| 863 return insertionIndex; | 905 return insertionIndex; |
| 864 } | 906 } |
| 865 else if ($eq(existingKey, key)) { | 907 else if ($eq(existingKey, key)) { |
| 866 return hash; | 908 return hash; |
| 867 } | 909 } |
| 868 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 910 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 869 insertionIndex = hash; | 911 insertionIndex = hash; |
| 870 } | 912 } |
| 871 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 913 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 872 } | 914 } |
| 873 } | 915 } |
| 874 HashMapImplementation.prototype._probeForLookup = function(key) { | 916 HashMapImplementation.prototype._probeForLookup = function(key) { |
| 875 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); | 917 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); |
| 876 var numberOfProbes = (1); | 918 var numberOfProbes = (1); |
| 877 var initialHash = hash; | 919 var initialHash = hash; |
| 878 while (true) { | 920 while (true) { |
| 879 var existingKey = this._keys.$index(hash); | 921 var existingKey = this._keys[hash]; |
| 880 if (existingKey == null) return (-1); | 922 if (existingKey == null) return (-1); |
| 881 if ($eq(existingKey, key)) return hash; | 923 if ($eq(existingKey, key)) return hash; |
| 882 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 924 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 883 } | 925 } |
| 884 } | 926 } |
| 885 HashMapImplementation.prototype._ensureCapacity = function() { | 927 HashMapImplementation.prototype._ensureCapacity = function() { |
| 886 var newNumberOfEntries = this._numberOfEntries + (1); | 928 var newNumberOfEntries = this._numberOfEntries + (1); |
| 887 if (newNumberOfEntries >= this._loadLimit) { | 929 if (newNumberOfEntries >= this._loadLimit) { |
| 888 this._grow(this._keys.get$length() * (2)); | 930 this._grow(this._keys.get$length() * (2)); |
| 889 return; | 931 return; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 900 } | 942 } |
| 901 HashMapImplementation.prototype._grow = function(newCapacity) { | 943 HashMapImplementation.prototype._grow = function(newCapacity) { |
| 902 var capacity = this._keys.get$length(); | 944 var capacity = this._keys.get$length(); |
| 903 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 945 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 904 var oldKeys = this._keys; | 946 var oldKeys = this._keys; |
| 905 var oldValues = this._values; | 947 var oldValues = this._values; |
| 906 this._keys = new Array(newCapacity); | 948 this._keys = new Array(newCapacity); |
| 907 this._values = new Array(newCapacity); | 949 this._values = new Array(newCapacity); |
| 908 for (var i = (0); | 950 for (var i = (0); |
| 909 i < capacity; i++) { | 951 i < capacity; i++) { |
| 910 var key = oldKeys.$index(i); | 952 var key = oldKeys[i]; |
| 911 if (key == null || key == const$0001) { | 953 if (key == null || key == const$0001) { |
| 912 continue; | 954 continue; |
| 913 } | 955 } |
| 914 var value = oldValues.$index(i); | 956 var value = oldValues[i]; |
| 915 var newIndex = this._probeForAdding(key); | 957 var newIndex = this._probeForAdding(key); |
| 916 this._keys.$setindex(newIndex, key); | 958 this._keys.$setindex(newIndex, key); |
| 917 this._values.$setindex(newIndex, value); | 959 this._values.$setindex(newIndex, value); |
| 918 } | 960 } |
| 919 this._numberOfDeleted = (0); | 961 this._numberOfDeleted = (0); |
| 920 } | 962 } |
| 921 HashMapImplementation.prototype.$setindex = function(key, value) { | 963 HashMapImplementation.prototype.$setindex = function(key, value) { |
| 922 this._ensureCapacity(); | 964 this._ensureCapacity(); |
| 923 var index = this._probeForAdding(key); | 965 var index = this._probeForAdding(key); |
| 924 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0 001)) { | 966 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 925 this._numberOfEntries++; | 967 this._numberOfEntries++; |
| 926 } | 968 } |
| 927 this._keys.$setindex(index, key); | 969 this._keys.$setindex(index, key); |
| 928 this._values.$setindex(index, value); | 970 this._values.$setindex(index, value); |
| 929 } | 971 } |
| 930 HashMapImplementation.prototype.$index = function(key) { | 972 HashMapImplementation.prototype.$index = function(key) { |
| 931 var index = this._probeForLookup(key); | 973 var index = this._probeForLookup(key); |
| 932 if (index < (0)) return null; | 974 if (index < (0)) return null; |
| 933 return this._values.$index(index); | 975 return this._values[index]; |
| 934 } | 976 } |
| 935 HashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { | 977 HashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { |
| 936 var index = this._probeForLookup(key); | 978 var index = this._probeForLookup(key); |
| 937 if (index >= (0)) return this._values.$index(index); | 979 if (index >= (0)) return this._values[index]; |
| 938 var value = ifAbsent(); | 980 var value = ifAbsent.call$0(); |
| 939 this.$setindex(key, value); | 981 this.$setindex(key, value); |
| 940 return value; | 982 return value; |
| 941 } | 983 } |
| 942 HashMapImplementation.prototype.remove = function(key) { | |
| 943 var index = this._probeForLookup(key); | |
| 944 if (index >= (0)) { | |
| 945 this._numberOfEntries--; | |
| 946 var value = this._values.$index(index); | |
| 947 this._values.$setindex(index); | |
| 948 this._keys.$setindex(index, const$0001); | |
| 949 this._numberOfDeleted++; | |
| 950 return value; | |
| 951 } | |
| 952 return null; | |
| 953 } | |
| 954 HashMapImplementation.prototype.isEmpty = function() { | 984 HashMapImplementation.prototype.isEmpty = function() { |
| 955 return this._numberOfEntries == (0); | 985 return this._numberOfEntries == (0); |
| 956 } | 986 } |
| 957 HashMapImplementation.prototype.get$length = function() { | 987 HashMapImplementation.prototype.get$length = function() { |
| 958 return this._numberOfEntries; | 988 return this._numberOfEntries; |
| 959 } | 989 } |
| 960 HashMapImplementation.prototype.forEach = function(f) { | 990 HashMapImplementation.prototype.forEach = function(f) { |
| 961 var length = this._keys.get$length(); | 991 var length = this._keys.get$length(); |
| 962 for (var i = (0); | 992 for (var i = (0); |
| 963 i < length; i++) { | 993 i < length; i++) { |
| 964 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001)) { | 994 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 965 f(this._keys.$index(i), this._values.$index(i)); | 995 f.call$2(this._keys[i], this._values[i]); |
| 966 } | 996 } |
| 967 } | 997 } |
| 968 } | 998 } |
| 969 HashMapImplementation.prototype.getKeys = function() { | 999 HashMapImplementation.prototype.getKeys = function() { |
| 970 var list = new Array(this.get$length()); | 1000 var list = new Array(this.get$length()); |
| 971 var i = (0); | 1001 var i = (0); |
| 972 this.forEach(function _(key, value) { | 1002 this.forEach(function _(key, value) { |
| 973 list.$setindex(i++, key); | 1003 list.$setindex(i++, key); |
| 974 } | 1004 } |
| 975 ); | 1005 ); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 987 HashMapImplementation.prototype.containsKey = function(key) { | 1017 HashMapImplementation.prototype.containsKey = function(key) { |
| 988 return (this._probeForLookup(key) != (-1)); | 1018 return (this._probeForLookup(key) != (-1)); |
| 989 } | 1019 } |
| 990 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype. containsKey; | 1020 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype. containsKey; |
| 991 HashMapImplementation.prototype.forEach$1 = function($0) { | 1021 HashMapImplementation.prototype.forEach$1 = function($0) { |
| 992 return this.forEach(to$call$2($0)); | 1022 return this.forEach(to$call$2($0)); |
| 993 }; | 1023 }; |
| 994 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK eys; | 1024 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK eys; |
| 995 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge tValues; | 1025 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge tValues; |
| 996 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm pty; | 1026 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm pty; |
| 997 HashMapImplementation.prototype.putIfAbsent$2 = function($0, $1) { | |
| 998 return this.putIfAbsent($0, to$call$0($1)); | |
| 999 }; | |
| 1000 // ********** Code for HashMapImplementation_E$E ************** | 1027 // ********** Code for HashMapImplementation_E$E ************** |
| 1001 $inherits(HashMapImplementation_E$E, HashMapImplementation); | 1028 $inherits(HashMapImplementation_E$E, HashMapImplementation); |
| 1002 function HashMapImplementation_E$E() { | 1029 function HashMapImplementation_E$E() { |
| 1003 this._numberOfEntries = (0); | 1030 this._numberOfEntries = (0); |
| 1004 this._numberOfDeleted = (0); | 1031 this._numberOfDeleted = (0); |
| 1005 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); | 1032 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); |
| 1006 this._keys = new Array((8)); | 1033 this._keys = new Array((8)); |
| 1007 this._values = new Array((8)); | 1034 this._values = new Array((8)); |
| 1008 } | 1035 } |
| 1009 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { | 1036 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { |
| 1010 return $truncdiv((capacity * (3)), (4)); | 1037 return $truncdiv((capacity * (3)), (4)); |
| 1011 } | 1038 } |
| 1012 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { | 1039 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { |
| 1013 return hashCode & (length - (1)); | 1040 return hashCode & (length - (1)); |
| 1014 } | 1041 } |
| 1015 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le ngth) { | 1042 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le ngth) { |
| 1016 return (currentProbe + numberOfProbes) & (length - (1)); | 1043 return (currentProbe + numberOfProbes) & (length - (1)); |
| 1017 } | 1044 } |
| 1018 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { | 1045 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { |
| 1019 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); | 1046 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); |
| 1020 var numberOfProbes = (1); | 1047 var numberOfProbes = (1); |
| 1021 var initialHash = hash; | 1048 var initialHash = hash; |
| 1022 var insertionIndex = (-1); | 1049 var insertionIndex = (-1); |
| 1023 while (true) { | 1050 while (true) { |
| 1024 var existingKey = this._keys.$index(hash); | 1051 var existingKey = this._keys[hash]; |
| 1025 if (existingKey == null) { | 1052 if (existingKey == null) { |
| 1026 if (insertionIndex < (0)) return hash; | 1053 if (insertionIndex < (0)) return hash; |
| 1027 return insertionIndex; | 1054 return insertionIndex; |
| 1028 } | 1055 } |
| 1029 else if ($eq(existingKey, key)) { | 1056 else if ($eq(existingKey, key)) { |
| 1030 return hash; | 1057 return hash; |
| 1031 } | 1058 } |
| 1032 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1059 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1033 insertionIndex = hash; | 1060 insertionIndex = hash; |
| 1034 } | 1061 } |
| 1035 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 1062 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 1036 } | 1063 } |
| 1037 } | 1064 } |
| 1038 HashMapImplementation_E$E.prototype._probeForLookup = function(key) { | 1065 HashMapImplementation_E$E.prototype._probeForLookup = function(key) { |
| 1039 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); | 1066 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); |
| 1040 var numberOfProbes = (1); | 1067 var numberOfProbes = (1); |
| 1041 var initialHash = hash; | 1068 var initialHash = hash; |
| 1042 while (true) { | 1069 while (true) { |
| 1043 var existingKey = this._keys.$index(hash); | 1070 var existingKey = this._keys[hash]; |
| 1044 if (existingKey == null) return (-1); | 1071 if (existingKey == null) return (-1); |
| 1045 if ($eq(existingKey, key)) return hash; | 1072 if ($eq(existingKey, key)) return hash; |
| 1046 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 1073 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 1047 } | 1074 } |
| 1048 } | 1075 } |
| 1049 HashMapImplementation_E$E.prototype._ensureCapacity = function() { | 1076 HashMapImplementation_E$E.prototype._ensureCapacity = function() { |
| 1050 var newNumberOfEntries = this._numberOfEntries + (1); | 1077 var newNumberOfEntries = this._numberOfEntries + (1); |
| 1051 if (newNumberOfEntries >= this._loadLimit) { | 1078 if (newNumberOfEntries >= this._loadLimit) { |
| 1052 this._grow(this._keys.get$length() * (2)); | 1079 this._grow(this._keys.get$length() * (2)); |
| 1053 return; | 1080 return; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1064 } | 1091 } |
| 1065 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { | 1092 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { |
| 1066 var capacity = this._keys.get$length(); | 1093 var capacity = this._keys.get$length(); |
| 1067 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1094 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1068 var oldKeys = this._keys; | 1095 var oldKeys = this._keys; |
| 1069 var oldValues = this._values; | 1096 var oldValues = this._values; |
| 1070 this._keys = new Array(newCapacity); | 1097 this._keys = new Array(newCapacity); |
| 1071 this._values = new Array(newCapacity); | 1098 this._values = new Array(newCapacity); |
| 1072 for (var i = (0); | 1099 for (var i = (0); |
| 1073 i < capacity; i++) { | 1100 i < capacity; i++) { |
| 1074 var key = oldKeys.$index(i); | 1101 var key = oldKeys[i]; |
| 1075 if (key == null || key == const$0001) { | 1102 if (key == null || key == const$0001) { |
| 1076 continue; | 1103 continue; |
| 1077 } | 1104 } |
| 1078 var value = oldValues.$index(i); | 1105 var value = oldValues[i]; |
| 1079 var newIndex = this._probeForAdding(key); | 1106 var newIndex = this._probeForAdding(key); |
| 1080 this._keys.$setindex(newIndex, key); | 1107 this._keys.$setindex(newIndex, key); |
| 1081 this._values.$setindex(newIndex, value); | 1108 this._values.$setindex(newIndex, value); |
| 1082 } | 1109 } |
| 1083 this._numberOfDeleted = (0); | 1110 this._numberOfDeleted = (0); |
| 1084 } | 1111 } |
| 1085 HashMapImplementation_E$E.prototype.$setindex = function(key, value) { | 1112 HashMapImplementation_E$E.prototype.$setindex = function(key, value) { |
| 1086 this._ensureCapacity(); | 1113 this._ensureCapacity(); |
| 1087 var index = this._probeForAdding(key); | 1114 var index = this._probeForAdding(key); |
| 1088 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0 001)) { | 1115 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 1089 this._numberOfEntries++; | 1116 this._numberOfEntries++; |
| 1090 } | 1117 } |
| 1091 this._keys.$setindex(index, key); | 1118 this._keys.$setindex(index, key); |
| 1092 this._values.$setindex(index, value); | 1119 this._values.$setindex(index, value); |
| 1093 } | 1120 } |
| 1094 HashMapImplementation_E$E.prototype.remove = function(key) { | |
| 1095 var index = this._probeForLookup(key); | |
| 1096 if (index >= (0)) { | |
| 1097 this._numberOfEntries--; | |
| 1098 var value = this._values.$index(index); | |
| 1099 this._values.$setindex(index); | |
| 1100 this._keys.$setindex(index, const$0001); | |
| 1101 this._numberOfDeleted++; | |
| 1102 return value; | |
| 1103 } | |
| 1104 return null; | |
| 1105 } | |
| 1106 HashMapImplementation_E$E.prototype.isEmpty = function() { | 1121 HashMapImplementation_E$E.prototype.isEmpty = function() { |
| 1107 return this._numberOfEntries == (0); | 1122 return this._numberOfEntries == (0); |
| 1108 } | 1123 } |
| 1109 HashMapImplementation_E$E.prototype.forEach = function(f) { | 1124 HashMapImplementation_E$E.prototype.forEach = function(f) { |
| 1110 var length = this._keys.get$length(); | 1125 var length = this._keys.get$length(); |
| 1111 for (var i = (0); | 1126 for (var i = (0); |
| 1112 i < length; i++) { | 1127 i < length; i++) { |
| 1113 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001)) { | 1128 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 1114 f(this._keys.$index(i), this._values.$index(i)); | 1129 f.call$2(this._keys[i], this._values[i]); |
| 1115 } | 1130 } |
| 1116 } | 1131 } |
| 1117 } | 1132 } |
| 1118 HashMapImplementation_E$E.prototype.getKeys = function() { | 1133 HashMapImplementation_E$E.prototype.getKeys = function() { |
| 1119 var list = new Array(this.get$length()); | 1134 var list = new Array(this.get$length()); |
| 1120 var i = (0); | 1135 var i = (0); |
| 1121 this.forEach(function _(key, value) { | 1136 this.forEach(function _(key, value) { |
| 1122 list.$setindex(i++, key); | 1137 list.$setindex(i++, key); |
| 1123 } | 1138 } |
| 1124 ); | 1139 ); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1147 } | 1162 } |
| 1148 HashMapImplementation_K$V._nextProbe = function(currentProbe, numberOfProbes, le ngth) { | 1163 HashMapImplementation_K$V._nextProbe = function(currentProbe, numberOfProbes, le ngth) { |
| 1149 return (currentProbe + numberOfProbes) & (length - (1)); | 1164 return (currentProbe + numberOfProbes) & (length - (1)); |
| 1150 } | 1165 } |
| 1151 HashMapImplementation_K$V.prototype._probeForAdding = function(key) { | 1166 HashMapImplementation_K$V.prototype._probeForAdding = function(key) { |
| 1152 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); | 1167 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); |
| 1153 var numberOfProbes = (1); | 1168 var numberOfProbes = (1); |
| 1154 var initialHash = hash; | 1169 var initialHash = hash; |
| 1155 var insertionIndex = (-1); | 1170 var insertionIndex = (-1); |
| 1156 while (true) { | 1171 while (true) { |
| 1157 var existingKey = this._keys.$index(hash); | 1172 var existingKey = this._keys[hash]; |
| 1158 if (existingKey == null) { | 1173 if (existingKey == null) { |
| 1159 if (insertionIndex < (0)) return hash; | 1174 if (insertionIndex < (0)) return hash; |
| 1160 return insertionIndex; | 1175 return insertionIndex; |
| 1161 } | 1176 } |
| 1162 else if ($eq(existingKey, key)) { | 1177 else if ($eq(existingKey, key)) { |
| 1163 return hash; | 1178 return hash; |
| 1164 } | 1179 } |
| 1165 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1180 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1166 insertionIndex = hash; | 1181 insertionIndex = hash; |
| 1167 } | 1182 } |
| 1168 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 1183 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 1169 } | 1184 } |
| 1170 } | 1185 } |
| 1171 HashMapImplementation_K$V.prototype._probeForLookup = function(key) { | 1186 HashMapImplementation_K$V.prototype._probeForLookup = function(key) { |
| 1172 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); | 1187 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$ length()); |
| 1173 var numberOfProbes = (1); | 1188 var numberOfProbes = (1); |
| 1174 var initialHash = hash; | 1189 var initialHash = hash; |
| 1175 while (true) { | 1190 while (true) { |
| 1176 var existingKey = this._keys.$index(hash); | 1191 var existingKey = this._keys[hash]; |
| 1177 if (existingKey == null) return (-1); | 1192 if (existingKey == null) return (-1); |
| 1178 if ($eq(existingKey, key)) return hash; | 1193 if ($eq(existingKey, key)) return hash; |
| 1179 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 1194 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 1180 } | 1195 } |
| 1181 } | 1196 } |
| 1182 HashMapImplementation_K$V.prototype._ensureCapacity = function() { | 1197 HashMapImplementation_K$V.prototype._ensureCapacity = function() { |
| 1183 var newNumberOfEntries = this._numberOfEntries + (1); | 1198 var newNumberOfEntries = this._numberOfEntries + (1); |
| 1184 if (newNumberOfEntries >= this._loadLimit) { | 1199 if (newNumberOfEntries >= this._loadLimit) { |
| 1185 this._grow(this._keys.get$length() * (2)); | 1200 this._grow(this._keys.get$length() * (2)); |
| 1186 return; | 1201 return; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1197 } | 1212 } |
| 1198 HashMapImplementation_K$V.prototype._grow = function(newCapacity) { | 1213 HashMapImplementation_K$V.prototype._grow = function(newCapacity) { |
| 1199 var capacity = this._keys.get$length(); | 1214 var capacity = this._keys.get$length(); |
| 1200 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1215 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1201 var oldKeys = this._keys; | 1216 var oldKeys = this._keys; |
| 1202 var oldValues = this._values; | 1217 var oldValues = this._values; |
| 1203 this._keys = new Array(newCapacity); | 1218 this._keys = new Array(newCapacity); |
| 1204 this._values = new Array(newCapacity); | 1219 this._values = new Array(newCapacity); |
| 1205 for (var i = (0); | 1220 for (var i = (0); |
| 1206 i < capacity; i++) { | 1221 i < capacity; i++) { |
| 1207 var key = oldKeys.$index(i); | 1222 var key = oldKeys[i]; |
| 1208 if (key == null || key == const$0001) { | 1223 if (key == null || key == const$0001) { |
| 1209 continue; | 1224 continue; |
| 1210 } | 1225 } |
| 1211 var value = oldValues.$index(i); | 1226 var value = oldValues[i]; |
| 1212 var newIndex = this._probeForAdding(key); | 1227 var newIndex = this._probeForAdding(key); |
| 1213 this._keys.$setindex(newIndex, key); | 1228 this._keys.$setindex(newIndex, key); |
| 1214 this._values.$setindex(newIndex, value); | 1229 this._values.$setindex(newIndex, value); |
| 1215 } | 1230 } |
| 1216 this._numberOfDeleted = (0); | 1231 this._numberOfDeleted = (0); |
| 1217 } | 1232 } |
| 1218 HashMapImplementation_K$V.prototype.$setindex = function(key, value) { | 1233 HashMapImplementation_K$V.prototype.$setindex = function(key, value) { |
| 1219 this._ensureCapacity(); | 1234 this._ensureCapacity(); |
| 1220 var index = this._probeForAdding(key); | 1235 var index = this._probeForAdding(key); |
| 1221 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0 001)) { | 1236 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 1222 this._numberOfEntries++; | 1237 this._numberOfEntries++; |
| 1223 } | 1238 } |
| 1224 this._keys.$setindex(index, key); | 1239 this._keys.$setindex(index, key); |
| 1225 this._values.$setindex(index, value); | 1240 this._values.$setindex(index, value); |
| 1226 } | 1241 } |
| 1227 HashMapImplementation_K$V.prototype.$index = function(key) { | 1242 HashMapImplementation_K$V.prototype.$index = function(key) { |
| 1228 var index = this._probeForLookup(key); | 1243 var index = this._probeForLookup(key); |
| 1229 if (index < (0)) return null; | 1244 if (index < (0)) return null; |
| 1230 return this._values.$index(index); | 1245 return this._values[index]; |
| 1231 } | 1246 } |
| 1232 HashMapImplementation_K$V.prototype.putIfAbsent = function(key, ifAbsent) { | 1247 HashMapImplementation_K$V.prototype.putIfAbsent = function(key, ifAbsent) { |
| 1233 var index = this._probeForLookup(key); | 1248 var index = this._probeForLookup(key); |
| 1234 if (index >= (0)) return this._values.$index(index); | 1249 if (index >= (0)) return this._values[index]; |
| 1235 var value = ifAbsent(); | 1250 var value = ifAbsent.call$0(); |
| 1236 this.$setindex(key, value); | 1251 this.$setindex(key, value); |
| 1237 return value; | 1252 return value; |
| 1238 } | 1253 } |
| 1239 HashMapImplementation_K$V.prototype.isEmpty = function() { | 1254 HashMapImplementation_K$V.prototype.isEmpty = function() { |
| 1240 return this._numberOfEntries == (0); | 1255 return this._numberOfEntries == (0); |
| 1241 } | 1256 } |
| 1242 HashMapImplementation_K$V.prototype.forEach = function(f) { | 1257 HashMapImplementation_K$V.prototype.forEach = function(f) { |
| 1243 var length = this._keys.get$length(); | 1258 var length = this._keys.get$length(); |
| 1244 for (var i = (0); | 1259 for (var i = (0); |
| 1245 i < length; i++) { | 1260 i < length; i++) { |
| 1246 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001)) { | 1261 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 1247 f(this._keys.$index(i), this._values.$index(i)); | 1262 f.call$2(this._keys[i], this._values[i]); |
| 1248 } | 1263 } |
| 1249 } | 1264 } |
| 1250 } | 1265 } |
| 1251 HashMapImplementation_K$V.prototype.getKeys = function() { | 1266 HashMapImplementation_K$V.prototype.getKeys = function() { |
| 1252 var list = new Array(this.get$length()); | 1267 var list = new Array(this.get$length()); |
| 1253 var i = (0); | 1268 var i = (0); |
| 1254 this.forEach(function _(key, value) { | 1269 this.forEach(function _(key, value) { |
| 1255 list.$setindex(i++, key); | 1270 list.$setindex(i++, key); |
| 1256 } | 1271 } |
| 1257 ); | 1272 ); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 1286 } | 1301 } |
| 1287 HashMapImplementation_dart_core_String$VariableValue._nextProbe = function(curre ntProbe, numberOfProbes, length) { | 1302 HashMapImplementation_dart_core_String$VariableValue._nextProbe = function(curre ntProbe, numberOfProbes, length) { |
| 1288 return (currentProbe + numberOfProbes) & (length - (1)); | 1303 return (currentProbe + numberOfProbes) & (length - (1)); |
| 1289 } | 1304 } |
| 1290 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForAdding = function(key) { | 1305 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForAdding = function(key) { |
| 1291 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le ngth()); | 1306 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le ngth()); |
| 1292 var numberOfProbes = (1); | 1307 var numberOfProbes = (1); |
| 1293 var initialHash = hash; | 1308 var initialHash = hash; |
| 1294 var insertionIndex = (-1); | 1309 var insertionIndex = (-1); |
| 1295 while (true) { | 1310 while (true) { |
| 1296 var existingKey = this._keys.$index(hash); | 1311 var existingKey = this._keys[hash]; |
|
Jennifer Messerly
2012/01/18 00:03:00
awesome!
| |
| 1297 if (existingKey == null) { | 1312 if (existingKey == null) { |
| 1298 if (insertionIndex < (0)) return hash; | 1313 if (insertionIndex < (0)) return hash; |
| 1299 return insertionIndex; | 1314 return insertionIndex; |
| 1300 } | 1315 } |
| 1301 else if ($eq(existingKey, key)) { | 1316 else if ($eq(existingKey, key)) { |
| 1302 return hash; | 1317 return hash; |
| 1303 } | 1318 } |
| 1304 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1319 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1305 insertionIndex = hash; | 1320 insertionIndex = hash; |
| 1306 } | 1321 } |
| 1307 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 1322 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 1308 } | 1323 } |
| 1309 } | 1324 } |
| 1310 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForLookup = function(key) { | 1325 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForLookup = function(key) { |
| 1311 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le ngth()); | 1326 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le ngth()); |
| 1312 var numberOfProbes = (1); | 1327 var numberOfProbes = (1); |
| 1313 var initialHash = hash; | 1328 var initialHash = hash; |
| 1314 while (true) { | 1329 while (true) { |
| 1315 var existingKey = this._keys.$index(hash); | 1330 var existingKey = this._keys[hash]; |
| 1316 if (existingKey == null) return (-1); | 1331 if (existingKey == null) return (-1); |
| 1317 if ($eq(existingKey, key)) return hash; | 1332 if ($eq(existingKey, key)) return hash; |
| 1318 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); | 1333 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g et$length()); |
| 1319 } | 1334 } |
| 1320 } | 1335 } |
| 1321 HashMapImplementation_dart_core_String$VariableValue.prototype._ensureCapacity = function() { | 1336 HashMapImplementation_dart_core_String$VariableValue.prototype._ensureCapacity = function() { |
| 1322 var newNumberOfEntries = this._numberOfEntries + (1); | 1337 var newNumberOfEntries = this._numberOfEntries + (1); |
| 1323 if (newNumberOfEntries >= this._loadLimit) { | 1338 if (newNumberOfEntries >= this._loadLimit) { |
| 1324 this._grow(this._keys.get$length() * (2)); | 1339 this._grow(this._keys.get$length() * (2)); |
| 1325 return; | 1340 return; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1336 } | 1351 } |
| 1337 HashMapImplementation_dart_core_String$VariableValue.prototype._grow = function( newCapacity) { | 1352 HashMapImplementation_dart_core_String$VariableValue.prototype._grow = function( newCapacity) { |
| 1338 var capacity = this._keys.get$length(); | 1353 var capacity = this._keys.get$length(); |
| 1339 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1354 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1340 var oldKeys = this._keys; | 1355 var oldKeys = this._keys; |
| 1341 var oldValues = this._values; | 1356 var oldValues = this._values; |
| 1342 this._keys = new Array(newCapacity); | 1357 this._keys = new Array(newCapacity); |
| 1343 this._values = new Array(newCapacity); | 1358 this._values = new Array(newCapacity); |
| 1344 for (var i = (0); | 1359 for (var i = (0); |
| 1345 i < capacity; i++) { | 1360 i < capacity; i++) { |
| 1346 var key = oldKeys.$index(i); | 1361 var key = oldKeys[i]; |
| 1347 if (key == null || key == const$0001) { | 1362 if (key == null || key == const$0001) { |
| 1348 continue; | 1363 continue; |
| 1349 } | 1364 } |
| 1350 var value = oldValues.$index(i); | 1365 var value = oldValues[i]; |
| 1351 var newIndex = this._probeForAdding(key); | 1366 var newIndex = this._probeForAdding(key); |
| 1352 this._keys.$setindex(newIndex, key); | 1367 this._keys.$setindex(newIndex, key); |
| 1353 this._values.$setindex(newIndex, value); | 1368 this._values.$setindex(newIndex, value); |
| 1354 } | 1369 } |
| 1355 this._numberOfDeleted = (0); | 1370 this._numberOfDeleted = (0); |
| 1356 } | 1371 } |
| 1357 HashMapImplementation_dart_core_String$VariableValue.prototype.$setindex = funct ion(key, value) { | 1372 HashMapImplementation_dart_core_String$VariableValue.prototype.$setindex = funct ion(key, value) { |
| 1358 this._ensureCapacity(); | 1373 this._ensureCapacity(); |
| 1359 var index = this._probeForAdding(key); | 1374 var index = this._probeForAdding(key); |
| 1360 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0 001)) { | 1375 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 1361 this._numberOfEntries++; | 1376 this._numberOfEntries++; |
| 1362 } | 1377 } |
| 1363 this._keys.$setindex(index, key); | 1378 this._keys.$setindex(index, key); |
| 1364 this._values.$setindex(index, value); | 1379 this._values.$setindex(index, value); |
| 1365 } | 1380 } |
| 1366 HashMapImplementation_dart_core_String$VariableValue.prototype.$index = function (key) { | 1381 HashMapImplementation_dart_core_String$VariableValue.prototype.$index = function (key) { |
| 1367 var index = this._probeForLookup(key); | 1382 var index = this._probeForLookup(key); |
| 1368 if (index < (0)) return null; | 1383 if (index < (0)) return null; |
| 1369 return this._values.$index(index); | 1384 return this._values[index]; |
| 1370 } | 1385 } |
| 1371 HashMapImplementation_dart_core_String$VariableValue.prototype.forEach = functio n(f) { | 1386 HashMapImplementation_dart_core_String$VariableValue.prototype.forEach = functio n(f) { |
| 1372 var length = this._keys.get$length(); | 1387 var length = this._keys.get$length(); |
| 1373 for (var i = (0); | 1388 for (var i = (0); |
| 1374 i < length; i++) { | 1389 i < length; i++) { |
| 1375 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001)) { | 1390 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 1376 f(this._keys.$index(i), this._values.$index(i)); | 1391 f.call$2(this._keys[i], this._values[i]); |
| 1377 } | 1392 } |
| 1378 } | 1393 } |
| 1379 } | 1394 } |
| 1380 HashMapImplementation_dart_core_String$VariableValue.prototype.containsKey = fun ction(key) { | 1395 HashMapImplementation_dart_core_String$VariableValue.prototype.containsKey = fun ction(key) { |
| 1381 return (this._probeForLookup(key) != (-1)); | 1396 return (this._probeForLookup(key) != (-1)); |
| 1382 } | 1397 } |
| 1383 // ********** Code for HashSetImplementation ************** | 1398 // ********** Code for HashSetImplementation ************** |
| 1384 function HashSetImplementation() { | 1399 function HashSetImplementation() { |
| 1385 this._backingMap = new HashMapImplementation_E$E(); | 1400 this._backingMap = new HashMapImplementation_E$E(); |
| 1386 } | 1401 } |
| 1387 HashSetImplementation.HashSetImplementation$from$factory = function(other) { | 1402 HashSetImplementation.HashSetImplementation$from$factory = function(other) { |
| 1388 var set = new HashSetImplementation_E(); | 1403 var set = new HashSetImplementation_E(); |
| 1389 for (var $$i = other.iterator$0(); $$i.hasNext$0(); ) { | 1404 for (var $$i = other.iterator$0(); $$i.hasNext$0(); ) { |
| 1390 var e = $$i.next$0(); | 1405 var e = $$i.next$0(); |
| 1391 set.add(e); | 1406 set.add(e); |
| 1392 } | 1407 } |
| 1393 return set; | 1408 return set; |
| 1394 } | 1409 } |
| 1395 HashSetImplementation.prototype.add = function(value) { | 1410 HashSetImplementation.prototype.add = function(value) { |
| 1396 this._backingMap.$setindex(value, value); | 1411 this._backingMap.$setindex(value, value); |
| 1397 } | 1412 } |
| 1398 HashSetImplementation.prototype.contains = function(value) { | 1413 HashSetImplementation.prototype.contains = function(value) { |
| 1399 return this._backingMap.containsKey(value); | 1414 return this._backingMap.containsKey(value); |
| 1400 } | 1415 } |
| 1401 HashSetImplementation.prototype.remove = function(value) { | |
| 1402 if (!this._backingMap.containsKey(value)) return false; | |
| 1403 this._backingMap.remove(value); | |
| 1404 return true; | |
| 1405 } | |
| 1406 HashSetImplementation.prototype.addAll = function(collection) { | 1416 HashSetImplementation.prototype.addAll = function(collection) { |
| 1407 var $this = this; // closure support | 1417 var $this = this; // closure support |
| 1408 collection.forEach(function _(value) { | 1418 collection.forEach(function _(value) { |
| 1409 $this.add(value); | 1419 $this.add(value); |
| 1410 } | 1420 } |
| 1411 ); | 1421 ); |
| 1412 } | 1422 } |
| 1413 HashSetImplementation.prototype.forEach = function(f) { | 1423 HashSetImplementation.prototype.forEach = function(f) { |
| 1414 this._backingMap.forEach(function _(key, value) { | 1424 this._backingMap.forEach(function _(key, value) { |
| 1415 f(key); | 1425 f.call$1(key); |
| 1416 } | 1426 } |
| 1417 ); | 1427 ); |
| 1418 } | 1428 } |
| 1419 HashSetImplementation.prototype.filter = function(f) { | 1429 HashSetImplementation.prototype.filter = function(f) { |
| 1420 var result = new HashSetImplementation(); | 1430 var result = new HashSetImplementation(); |
| 1421 this._backingMap.forEach(function _(key, value) { | 1431 this._backingMap.forEach(function _(key, value) { |
| 1422 if (f(key)) result.add(key); | 1432 if (f.call$1(key)) result.add(key); |
| 1423 } | 1433 } |
| 1424 ); | 1434 ); |
| 1425 return result; | 1435 return result; |
| 1426 } | 1436 } |
| 1427 HashSetImplementation.prototype.every = function(f) { | 1437 HashSetImplementation.prototype.every = function(f) { |
| 1428 var keys = this._backingMap.getKeys(); | 1438 var keys = this._backingMap.getKeys(); |
| 1429 return keys.every(f); | 1439 return keys.every(f); |
| 1430 } | 1440 } |
| 1431 HashSetImplementation.prototype.some = function(f) { | 1441 HashSetImplementation.prototype.some = function(f) { |
| 1432 var keys = this._backingMap.getKeys(); | 1442 var keys = this._backingMap.getKeys(); |
| 1433 return keys.some(f); | 1443 return keys.some(f); |
| 1434 } | 1444 } |
| 1435 HashSetImplementation.prototype.isEmpty = function() { | 1445 HashSetImplementation.prototype.isEmpty = function() { |
| 1436 return this._backingMap.isEmpty(); | 1446 return this._backingMap.isEmpty(); |
| 1437 } | 1447 } |
| 1438 HashSetImplementation.prototype.get$length = function() { | 1448 HashSetImplementation.prototype.get$length = function() { |
| 1439 return this._backingMap.get$length(); | 1449 return this._backingMap.get$length(); |
| 1440 } | 1450 } |
| 1441 HashSetImplementation.prototype.iterator = function() { | 1451 HashSetImplementation.prototype.iterator = function() { |
| 1442 return new HashSetIterator_E(this); | 1452 return new HashSetIterator_E(this); |
| 1443 } | 1453 } |
| 1444 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; | 1454 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; |
| 1445 HashSetImplementation.prototype.addAll$1 = HashSetImplementation.prototype.addAl l; | 1455 HashSetImplementation.prototype.addAll$1 = HashSetImplementation.prototype.addAl l; |
| 1446 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con tains; | 1456 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con tains; |
| 1447 HashSetImplementation.prototype.every$1 = function($0) { | |
| 1448 return this.every(to$call$1($0)); | |
| 1449 }; | |
| 1450 HashSetImplementation.prototype.filter$1 = function($0) { | 1457 HashSetImplementation.prototype.filter$1 = function($0) { |
| 1451 return this.filter(to$call$1($0)); | 1458 return this.filter(to$call$1($0)); |
| 1452 }; | 1459 }; |
| 1453 HashSetImplementation.prototype.forEach$1 = function($0) { | 1460 HashSetImplementation.prototype.forEach$1 = function($0) { |
| 1454 return this.forEach(to$call$1($0)); | 1461 return this.forEach(to$call$1($0)); |
| 1455 }; | 1462 }; |
| 1456 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm pty; | 1463 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm pty; |
| 1457 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite rator; | 1464 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite rator; |
| 1458 HashSetImplementation.prototype.some$1 = function($0) { | |
| 1459 return this.some(to$call$1($0)); | |
| 1460 }; | |
| 1461 // ********** Code for HashSetImplementation_E ************** | 1465 // ********** Code for HashSetImplementation_E ************** |
| 1462 $inherits(HashSetImplementation_E, HashSetImplementation); | 1466 $inherits(HashSetImplementation_E, HashSetImplementation); |
| 1463 function HashSetImplementation_E() { | 1467 function HashSetImplementation_E() { |
| 1464 this._backingMap = new HashMapImplementation_E$E(); | 1468 this._backingMap = new HashMapImplementation_E$E(); |
| 1465 } | 1469 } |
| 1466 // ********** Code for HashSetImplementation_Library ************** | 1470 // ********** Code for HashSetImplementation_Library ************** |
| 1467 $inherits(HashSetImplementation_Library, HashSetImplementation); | 1471 $inherits(HashSetImplementation_Library, HashSetImplementation); |
| 1468 function HashSetImplementation_Library() {} | 1472 function HashSetImplementation_Library() {} |
| 1473 // ********** Code for HashSetImplementation_Member ************** | |
| 1474 $inherits(HashSetImplementation_Member, HashSetImplementation); | |
| 1475 function HashSetImplementation_Member() {} | |
| 1469 // ********** Code for HashSetImplementation_dart_core_String ************** | 1476 // ********** Code for HashSetImplementation_dart_core_String ************** |
| 1470 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation); | 1477 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation); |
| 1471 function HashSetImplementation_dart_core_String() {} | 1478 function HashSetImplementation_dart_core_String() {} |
| 1472 // ********** Code for HashSetImplementation_Type ************** | 1479 // ********** Code for HashSetImplementation_Type ************** |
| 1473 $inherits(HashSetImplementation_Type, HashSetImplementation); | 1480 $inherits(HashSetImplementation_Type, HashSetImplementation); |
| 1474 function HashSetImplementation_Type() {} | 1481 function HashSetImplementation_Type() {} |
| 1475 // ********** Code for HashSetIterator ************** | 1482 // ********** Code for HashSetIterator ************** |
| 1476 function HashSetIterator(set_) { | 1483 function HashSetIterator(set_) { |
| 1477 this._entries = set_._backingMap._keys; | 1484 this._entries = set_._backingMap._keys; |
| 1478 this._nextValidIndex = (-1); | 1485 this._nextValidIndex = (-1); |
| 1479 this._advance(); | 1486 this._advance(); |
| 1480 } | 1487 } |
| 1481 HashSetIterator.prototype.hasNext = function() { | 1488 HashSetIterator.prototype.hasNext = function() { |
| 1482 if (this._nextValidIndex >= this._entries.get$length()) return false; | 1489 if (this._nextValidIndex >= this._entries.get$length()) return false; |
| 1483 if (this._entries.$index(this._nextValidIndex) == const$0001) { | 1490 if (this._entries[this._nextValidIndex] == const$0001) { |
| 1484 this._advance(); | 1491 this._advance(); |
| 1485 } | 1492 } |
| 1486 return this._nextValidIndex < this._entries.get$length(); | 1493 return this._nextValidIndex < this._entries.get$length(); |
| 1487 } | 1494 } |
| 1488 HashSetIterator.prototype.next = function() { | 1495 HashSetIterator.prototype.next = function() { |
| 1489 if (!this.hasNext()) { | 1496 if (!this.hasNext()) { |
| 1490 $throw(const$0005); | 1497 $throw(const$0005); |
| 1491 } | 1498 } |
| 1492 var res = this._entries.$index(this._nextValidIndex); | 1499 var res = this._entries[this._nextValidIndex]; |
| 1493 this._advance(); | 1500 this._advance(); |
| 1494 return res; | 1501 return res; |
| 1495 } | 1502 } |
| 1496 HashSetIterator.prototype._advance = function() { | 1503 HashSetIterator.prototype._advance = function() { |
| 1497 var length = this._entries.get$length(); | 1504 var length = this._entries.get$length(); |
| 1498 var entry; | 1505 var entry; |
| 1499 var deletedKey = const$0001; | 1506 var deletedKey = const$0001; |
| 1500 do { | 1507 do { |
| 1501 if (++this._nextValidIndex >= length) break; | 1508 if (++this._nextValidIndex >= length) break; |
| 1502 entry = this._entries.$index(this._nextValidIndex); | 1509 entry = this._entries[this._nextValidIndex]; |
| 1503 } | 1510 } |
| 1504 while ((entry == null) || (entry == deletedKey)) | 1511 while ((entry == null) || (entry == deletedKey)) |
| 1505 } | 1512 } |
| 1506 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; | 1513 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; |
| 1507 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; | 1514 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; |
| 1508 // ********** Code for HashSetIterator_E ************** | 1515 // ********** Code for HashSetIterator_E ************** |
| 1509 $inherits(HashSetIterator_E, HashSetIterator); | 1516 $inherits(HashSetIterator_E, HashSetIterator); |
| 1510 function HashSetIterator_E(set_) { | 1517 function HashSetIterator_E(set_) { |
| 1511 this._nextValidIndex = (-1); | 1518 this._nextValidIndex = (-1); |
| 1512 this._entries = set_._backingMap._keys; | 1519 this._entries = set_._backingMap._keys; |
| 1513 this._advance(); | 1520 this._advance(); |
| 1514 } | 1521 } |
| 1515 HashSetIterator_E.prototype._advance = function() { | 1522 HashSetIterator_E.prototype._advance = function() { |
| 1516 var length = this._entries.get$length(); | 1523 var length = this._entries.get$length(); |
| 1517 var entry; | 1524 var entry; |
| 1518 var deletedKey = const$0001; | 1525 var deletedKey = const$0001; |
| 1519 do { | 1526 do { |
| 1520 if (++this._nextValidIndex >= length) break; | 1527 if (++this._nextValidIndex >= length) break; |
| 1521 entry = this._entries.$index(this._nextValidIndex); | 1528 entry = this._entries[this._nextValidIndex]; |
| 1522 } | 1529 } |
| 1523 while ((entry == null) || (entry == deletedKey)) | 1530 while ((entry == null) || (entry == deletedKey)) |
| 1524 } | 1531 } |
| 1525 // ********** Code for _DeletedKeySentinel ************** | 1532 // ********** Code for _DeletedKeySentinel ************** |
| 1526 function _DeletedKeySentinel() { | 1533 function _DeletedKeySentinel() { |
| 1527 | 1534 |
| 1528 } | 1535 } |
| 1529 // ********** Code for KeyValuePair ************** | 1536 // ********** Code for KeyValuePair ************** |
| 1530 function KeyValuePair(key, value) { | 1537 function KeyValuePair(key, value) { |
| 1531 this.value = value; | 1538 this.value = value; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 1554 } | 1561 } |
| 1555 } | 1562 } |
| 1556 LinkedHashMapImplementation.prototype.$index = function(key) { | 1563 LinkedHashMapImplementation.prototype.$index = function(key) { |
| 1557 var entry = this._map.$index(key); | 1564 var entry = this._map.$index(key); |
| 1558 if (entry == null) return null; | 1565 if (entry == null) return null; |
| 1559 return entry.get$element().get$value(); | 1566 return entry.get$element().get$value(); |
| 1560 } | 1567 } |
| 1561 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { | 1568 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { |
| 1562 var value = this.$index(key); | 1569 var value = this.$index(key); |
| 1563 if ((this.$index(key) == null) && !(this.containsKey(key))) { | 1570 if ((this.$index(key) == null) && !(this.containsKey(key))) { |
| 1564 value = ifAbsent(); | 1571 value = ifAbsent.call$0(); |
| 1565 this.$setindex(key, value); | 1572 this.$setindex(key, value); |
| 1566 } | 1573 } |
| 1567 return value; | 1574 return value; |
| 1568 } | 1575 } |
| 1569 LinkedHashMapImplementation.prototype.getKeys = function() { | 1576 LinkedHashMapImplementation.prototype.getKeys = function() { |
| 1570 var list = new Array(this.get$length()); | 1577 var list = new Array(this.get$length()); |
| 1571 var index = (0); | 1578 var index = (0); |
| 1572 this._list.forEach(function _(entry) { | 1579 this._list.forEach(function _(entry) { |
| 1573 list.$setindex(index++, entry.key); | 1580 list.$setindex(index++, entry.key); |
| 1574 } | 1581 } |
| 1575 ); | 1582 ); |
| 1576 return list; | 1583 return list; |
| 1577 } | 1584 } |
| 1578 LinkedHashMapImplementation.prototype.getValues = function() { | 1585 LinkedHashMapImplementation.prototype.getValues = function() { |
| 1579 var list = new Array(this.get$length()); | 1586 var list = new Array(this.get$length()); |
| 1580 var index = (0); | 1587 var index = (0); |
| 1581 this._list.forEach(function _(entry) { | 1588 this._list.forEach(function _(entry) { |
| 1582 list.$setindex(index++, entry.value); | 1589 list.$setindex(index++, entry.value); |
| 1583 } | 1590 } |
| 1584 ); | 1591 ); |
| 1585 return list; | 1592 return list; |
| 1586 } | 1593 } |
| 1587 LinkedHashMapImplementation.prototype.forEach = function(f) { | 1594 LinkedHashMapImplementation.prototype.forEach = function(f) { |
| 1588 this._list.forEach(function _(entry) { | 1595 this._list.forEach(function _(entry) { |
| 1589 f(entry.key, entry.value); | 1596 f.call$2(entry.key, entry.value); |
| 1590 } | 1597 } |
| 1591 ); | 1598 ); |
| 1592 } | 1599 } |
| 1593 LinkedHashMapImplementation.prototype.containsKey = function(key) { | 1600 LinkedHashMapImplementation.prototype.containsKey = function(key) { |
| 1594 return this._map.containsKey(key); | 1601 return this._map.containsKey(key); |
| 1595 } | 1602 } |
| 1596 LinkedHashMapImplementation.prototype.get$length = function() { | 1603 LinkedHashMapImplementation.prototype.get$length = function() { |
| 1597 return this._map.get$length(); | 1604 return this._map.get$length(); |
| 1598 } | 1605 } |
| 1599 LinkedHashMapImplementation.prototype.isEmpty = function() { | 1606 LinkedHashMapImplementation.prototype.isEmpty = function() { |
| 1600 return this.get$length() == (0); | 1607 return this.get$length() == (0); |
| 1601 } | 1608 } |
| 1602 LinkedHashMapImplementation.prototype.containsKey$1 = LinkedHashMapImplementatio n.prototype.containsKey; | 1609 LinkedHashMapImplementation.prototype.containsKey$1 = LinkedHashMapImplementatio n.prototype.containsKey; |
| 1603 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { | 1610 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { |
| 1604 return this.forEach(to$call$2($0)); | 1611 return this.forEach(to$call$2($0)); |
| 1605 }; | 1612 }; |
| 1606 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr ototype.getKeys; | 1613 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr ototype.getKeys; |
| 1607 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation. prototype.getValues; | 1614 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation. prototype.getValues; |
| 1608 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr ototype.isEmpty; | 1615 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr ototype.isEmpty; |
| 1609 LinkedHashMapImplementation.prototype.putIfAbsent$2 = function($0, $1) { | |
| 1610 return this.putIfAbsent($0, to$call$0($1)); | |
| 1611 }; | |
| 1612 // ********** Code for DoubleLinkedQueueEntry ************** | 1616 // ********** Code for DoubleLinkedQueueEntry ************** |
| 1613 function DoubleLinkedQueueEntry(e) { | 1617 function DoubleLinkedQueueEntry(e) { |
| 1614 this._element = e; | 1618 this._element = e; |
| 1615 } | 1619 } |
| 1616 DoubleLinkedQueueEntry.prototype._link = function(p, n) { | 1620 DoubleLinkedQueueEntry.prototype._link = function(p, n) { |
| 1617 this._next = n; | 1621 this._next = n; |
| 1618 this._previous = p; | 1622 this._previous = p; |
| 1619 p._next = this; | 1623 p._next = this; |
| 1620 n._previous = this; | 1624 n._previous = this; |
| 1621 } | 1625 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1758 ); | 1762 ); |
| 1759 return counter; | 1763 return counter; |
| 1760 } | 1764 } |
| 1761 DoubleLinkedQueue.prototype.isEmpty = function() { | 1765 DoubleLinkedQueue.prototype.isEmpty = function() { |
| 1762 return (this._sentinel._next == this._sentinel); | 1766 return (this._sentinel._next == this._sentinel); |
| 1763 } | 1767 } |
| 1764 DoubleLinkedQueue.prototype.forEach = function(f) { | 1768 DoubleLinkedQueue.prototype.forEach = function(f) { |
| 1765 var entry = this._sentinel._next; | 1769 var entry = this._sentinel._next; |
| 1766 while (entry != this._sentinel) { | 1770 while (entry != this._sentinel) { |
| 1767 var nextEntry = entry._next; | 1771 var nextEntry = entry._next; |
| 1768 f(entry._element); | 1772 f.call$1(entry._element); |
| 1769 entry = nextEntry; | 1773 entry = nextEntry; |
| 1770 } | 1774 } |
| 1771 } | 1775 } |
| 1772 DoubleLinkedQueue.prototype.every = function(f) { | 1776 DoubleLinkedQueue.prototype.every = function(f) { |
| 1773 var entry = this._sentinel._next; | 1777 var entry = this._sentinel._next; |
| 1774 while (entry != this._sentinel) { | 1778 while (entry != this._sentinel) { |
| 1775 var nextEntry = entry._next; | 1779 var nextEntry = entry._next; |
| 1776 if (!f(entry._element)) return false; | 1780 if (!f.call$1(entry._element)) return false; |
| 1777 entry = nextEntry; | 1781 entry = nextEntry; |
| 1778 } | 1782 } |
| 1779 return true; | 1783 return true; |
| 1780 } | 1784 } |
| 1781 DoubleLinkedQueue.prototype.some = function(f) { | 1785 DoubleLinkedQueue.prototype.some = function(f) { |
| 1782 var entry = this._sentinel._next; | 1786 var entry = this._sentinel._next; |
| 1783 while (entry != this._sentinel) { | 1787 while (entry != this._sentinel) { |
| 1784 var nextEntry = entry._next; | 1788 var nextEntry = entry._next; |
| 1785 if (f(entry._element)) return true; | 1789 if (f.call$1(entry._element)) return true; |
| 1786 entry = nextEntry; | 1790 entry = nextEntry; |
| 1787 } | 1791 } |
| 1788 return false; | 1792 return false; |
| 1789 } | 1793 } |
| 1790 DoubleLinkedQueue.prototype.filter = function(f) { | 1794 DoubleLinkedQueue.prototype.filter = function(f) { |
| 1791 var other = new DoubleLinkedQueue(); | 1795 var other = new DoubleLinkedQueue(); |
| 1792 var entry = this._sentinel._next; | 1796 var entry = this._sentinel._next; |
| 1793 while (entry != this._sentinel) { | 1797 while (entry != this._sentinel) { |
| 1794 var nextEntry = entry._next; | 1798 var nextEntry = entry._next; |
| 1795 if (f(entry._element)) other.addLast(entry._element); | 1799 if (f.call$1(entry._element)) other.addLast(entry._element); |
| 1796 entry = nextEntry; | 1800 entry = nextEntry; |
| 1797 } | 1801 } |
| 1798 return other; | 1802 return other; |
| 1799 } | 1803 } |
| 1800 DoubleLinkedQueue.prototype.iterator = function() { | 1804 DoubleLinkedQueue.prototype.iterator = function() { |
| 1801 return new _DoubleLinkedQueueIterator_E(this._sentinel); | 1805 return new _DoubleLinkedQueueIterator_E(this._sentinel); |
| 1802 } | 1806 } |
| 1803 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; | 1807 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; |
| 1804 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll; | 1808 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll; |
| 1805 DoubleLinkedQueue.prototype.addLast$1 = DoubleLinkedQueue.prototype.addLast; | 1809 DoubleLinkedQueue.prototype.addLast$1 = DoubleLinkedQueue.prototype.addLast; |
| 1806 DoubleLinkedQueue.prototype.every$1 = function($0) { | |
| 1807 return this.every(to$call$1($0)); | |
| 1808 }; | |
| 1809 DoubleLinkedQueue.prototype.filter$1 = function($0) { | 1810 DoubleLinkedQueue.prototype.filter$1 = function($0) { |
| 1810 return this.filter(to$call$1($0)); | 1811 return this.filter(to$call$1($0)); |
| 1811 }; | 1812 }; |
| 1812 DoubleLinkedQueue.prototype.forEach$1 = function($0) { | 1813 DoubleLinkedQueue.prototype.forEach$1 = function($0) { |
| 1813 return this.forEach(to$call$1($0)); | 1814 return this.forEach(to$call$1($0)); |
| 1814 }; | 1815 }; |
| 1815 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; | 1816 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; |
| 1816 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; | 1817 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; |
| 1817 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; | 1818 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; |
| 1818 DoubleLinkedQueue.prototype.removeFirst$0 = DoubleLinkedQueue.prototype.removeFi rst; | |
| 1819 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas t; | 1819 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas t; |
| 1820 DoubleLinkedQueue.prototype.some$1 = function($0) { | |
| 1821 return this.some(to$call$1($0)); | |
| 1822 }; | |
| 1823 // ********** Code for DoubleLinkedQueue_E ************** | 1820 // ********** Code for DoubleLinkedQueue_E ************** |
| 1824 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); | 1821 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); |
| 1825 function DoubleLinkedQueue_E() {} | 1822 function DoubleLinkedQueue_E() {} |
| 1826 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** | 1823 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** |
| 1827 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); | 1824 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); |
| 1828 function DoubleLinkedQueue_KeyValuePair_K$V() { | 1825 function DoubleLinkedQueue_KeyValuePair_K$V() { |
| 1829 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); | 1826 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); |
| 1830 } | 1827 } |
| 1831 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { | 1828 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { |
| 1832 this._sentinel.prepend(value); | 1829 this._sentinel.prepend(value); |
| 1833 } | 1830 } |
| 1834 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { | 1831 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { |
| 1835 return this._sentinel.previousEntry(); | 1832 return this._sentinel.previousEntry(); |
| 1836 } | 1833 } |
| 1837 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { | 1834 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { |
| 1838 var entry = this._sentinel._next; | 1835 var entry = this._sentinel._next; |
| 1839 while (entry != this._sentinel) { | 1836 while (entry != this._sentinel) { |
| 1840 var nextEntry = entry._next; | 1837 var nextEntry = entry._next; |
| 1841 f(entry._element); | 1838 f.call$1(entry._element); |
| 1842 entry = nextEntry; | 1839 entry = nextEntry; |
| 1843 } | 1840 } |
| 1844 } | 1841 } |
| 1845 // ********** Code for _DoubleLinkedQueueIterator ************** | 1842 // ********** Code for _DoubleLinkedQueueIterator ************** |
| 1846 function _DoubleLinkedQueueIterator(_sentinel) { | 1843 function _DoubleLinkedQueueIterator(_sentinel) { |
| 1847 this._sentinel = _sentinel; | 1844 this._sentinel = _sentinel; |
| 1848 this._currentEntry = this._sentinel; | 1845 this._currentEntry = this._sentinel; |
| 1849 } | 1846 } |
| 1850 _DoubleLinkedQueueIterator.prototype.hasNext = function() { | 1847 _DoubleLinkedQueueIterator.prototype.hasNext = function() { |
| 1851 return this._currentEntry._next != this._sentinel; | 1848 return this._currentEntry._next != this._sentinel; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1913 StringBufferImpl.prototype.get$length = function() { | 1910 StringBufferImpl.prototype.get$length = function() { |
| 1914 return this._length; | 1911 return this._length; |
| 1915 } | 1912 } |
| 1916 StringBufferImpl.prototype.isEmpty = function() { | 1913 StringBufferImpl.prototype.isEmpty = function() { |
| 1917 return this._length == (0); | 1914 return this._length == (0); |
| 1918 } | 1915 } |
| 1919 StringBufferImpl.prototype.add = function(obj) { | 1916 StringBufferImpl.prototype.add = function(obj) { |
| 1920 var str = obj.toString$0(); | 1917 var str = obj.toString$0(); |
| 1921 if (str == null || str.isEmpty()) return this; | 1918 if (str == null || str.isEmpty()) return this; |
| 1922 this._buffer.add(str); | 1919 this._buffer.add(str); |
| 1923 this._length += str.length; | 1920 this._length = this._length + str.length; |
| 1924 return this; | 1921 return this; |
| 1925 } | 1922 } |
| 1926 StringBufferImpl.prototype.addAll = function(objects) { | 1923 StringBufferImpl.prototype.addAll = function(objects) { |
| 1927 for (var $$i = objects.iterator$0(); $$i.hasNext$0(); ) { | 1924 for (var $$i = objects.iterator$0(); $$i.hasNext$0(); ) { |
| 1928 var obj = $$i.next$0(); | 1925 var obj = $$i.next$0(); |
| 1929 this.add(obj); | 1926 this.add(obj); |
| 1930 } | 1927 } |
| 1931 return this; | 1928 return this; |
| 1932 } | 1929 } |
| 1933 StringBufferImpl.prototype.clear = function() { | 1930 StringBufferImpl.prototype.clear = function() { |
| 1934 this._buffer = new Array(); | 1931 this._buffer = new Array(); |
| 1935 this._length = (0); | 1932 this._length = (0); |
| 1936 return this; | 1933 return this; |
| 1937 } | 1934 } |
| 1938 StringBufferImpl.prototype.toString = function() { | 1935 StringBufferImpl.prototype.toString = function() { |
| 1939 if (this._buffer.get$length() == (0)) return ""; | 1936 if (this._buffer.get$length() == (0)) return ""; |
| 1940 if (this._buffer.get$length() == (1)) return this._buffer.$index((0)); | 1937 if (this._buffer.get$length() == (1)) return this._buffer[(0)]; |
| 1941 var result = StringBase.concatAll(this._buffer); | 1938 var result = StringBase.concatAll(this._buffer); |
| 1942 this._buffer.clear(); | 1939 this._buffer.clear(); |
| 1943 this._buffer.add(result); | 1940 this._buffer.add(result); |
| 1944 return result; | 1941 return result; |
| 1945 } | 1942 } |
| 1946 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; | 1943 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; |
| 1947 StringBufferImpl.prototype.addAll$1 = StringBufferImpl.prototype.addAll; | 1944 StringBufferImpl.prototype.addAll$1 = StringBufferImpl.prototype.addAll; |
| 1948 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; | 1945 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; |
| 1949 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; | 1946 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; |
| 1950 // ********** Code for StringBase ************** | 1947 // ********** Code for StringBase ************** |
| 1951 function StringBase() {} | 1948 function StringBase() {} |
| 1952 StringBase.createFromCharCodes = function(charCodes) { | 1949 StringBase.createFromCharCodes = function(charCodes) { |
| 1953 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { | 1950 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { |
| 1954 charCodes = new ListFactory.ListFactory$from$factory(charCodes); | 1951 charCodes = new ListFactory.ListFactory$from$factory(charCodes); |
| 1955 } | 1952 } |
| 1956 return String.fromCharCode.apply(null, charCodes); | 1953 return String.fromCharCode.apply(null, charCodes); |
| 1957 } | 1954 } |
| 1958 StringBase.join = function(strings, separator) { | 1955 StringBase.join = function(strings, separator) { |
| 1959 if (strings.get$length() == (0)) return ""; | 1956 if (strings.get$length() == (0)) return ""; |
| 1960 var s = strings.$index((0)); | 1957 var s = strings[(0)]; |
| 1961 for (var i = (1); | 1958 for (var i = (1); |
| 1962 i < strings.get$length(); i++) { | 1959 i < strings.get$length(); i++) { |
| 1963 s = s + separator + strings.$index(i); | 1960 s = s + separator + strings[i]; |
| 1964 } | 1961 } |
| 1965 return s; | 1962 return s; |
| 1966 } | 1963 } |
| 1967 StringBase.concatAll = function(strings) { | 1964 StringBase.concatAll = function(strings) { |
| 1968 return StringBase.join(strings, ""); | 1965 return StringBase.join(strings, ""); |
| 1969 } | 1966 } |
| 1970 // ********** Code for StringImplementation ************** | 1967 // ********** Code for StringImplementation ************** |
| 1971 StringImplementation = String; | 1968 StringImplementation = String; |
| 1972 StringImplementation.prototype.get$length = function() { return this.length; }; | 1969 StringImplementation.prototype.get$length = function() { return this.length; }; |
| 1973 StringImplementation.prototype.endsWith = function(other) { | 1970 StringImplementation.prototype.endsWith = function(other) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2045 StringImplementation.prototype.isEmpty$0 = StringImplementation.prototype.isEmpt y; | 2042 StringImplementation.prototype.isEmpty$0 = StringImplementation.prototype.isEmpt y; |
| 2046 StringImplementation.prototype.replaceFirst$2 = StringImplementation.prototype.r eplaceFirst; | 2043 StringImplementation.prototype.replaceFirst$2 = StringImplementation.prototype.r eplaceFirst; |
| 2047 StringImplementation.prototype.startsWith$1 = StringImplementation.prototype.sta rtsWith; | 2044 StringImplementation.prototype.startsWith$1 = StringImplementation.prototype.sta rtsWith; |
| 2048 StringImplementation.prototype.substring$1 = StringImplementation.prototype.subs tring; | 2045 StringImplementation.prototype.substring$1 = StringImplementation.prototype.subs tring; |
| 2049 StringImplementation.prototype.substring$2 = StringImplementation.prototype.subs tring; | 2046 StringImplementation.prototype.substring$2 = StringImplementation.prototype.subs tring; |
| 2050 // ********** Code for Collections ************** | 2047 // ********** Code for Collections ************** |
| 2051 function Collections() {} | 2048 function Collections() {} |
| 2052 Collections.forEach = function(iterable, f) { | 2049 Collections.forEach = function(iterable, f) { |
| 2053 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2050 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2054 var e = $$i.next$0(); | 2051 var e = $$i.next$0(); |
| 2055 f(e); | 2052 f.call$1(e); |
| 2056 } | 2053 } |
| 2057 } | 2054 } |
| 2058 Collections.some = function(iterable, f) { | 2055 Collections.some = function(iterable, f) { |
| 2059 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2056 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2060 var e = $$i.next$0(); | 2057 var e = $$i.next$0(); |
| 2061 if (f(e)) return true; | 2058 if (f.call$1(e)) return true; |
| 2062 } | 2059 } |
| 2063 return false; | 2060 return false; |
| 2064 } | 2061 } |
| 2065 Collections.every = function(iterable, f) { | 2062 Collections.every = function(iterable, f) { |
| 2066 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2063 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2067 var e = $$i.next$0(); | 2064 var e = $$i.next$0(); |
| 2068 if (!f(e)) return false; | 2065 if (!f.call$1(e)) return false; |
| 2069 } | 2066 } |
| 2070 return true; | 2067 return true; |
| 2071 } | 2068 } |
| 2072 Collections.filter = function(source, destination, f) { | 2069 Collections.filter = function(source, destination, f) { |
| 2073 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { | 2070 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { |
| 2074 var e = $$i.next$0(); | 2071 var e = $$i.next$0(); |
| 2075 if (f(e)) destination.add(e); | 2072 if (f.call$1(e)) destination.add(e); |
| 2076 } | 2073 } |
| 2077 return destination; | 2074 return destination; |
| 2078 } | 2075 } |
| 2079 // ********** Code for _Worker ************** | 2076 // ********** Code for _Worker ************** |
| 2080 // ********** Code for _ArgumentMismatchException ************** | 2077 // ********** Code for _ArgumentMismatchException ************** |
| 2081 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException); | 2078 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException); |
| 2082 function _ArgumentMismatchException(_message) { | 2079 function _ArgumentMismatchException(_message) { |
| 2083 this._dart_coreimpl_message = _message; | 2080 this._dart_coreimpl_message = _message; |
| 2084 ClosureArgumentMismatchException.call(this); | 2081 ClosureArgumentMismatchException.call(this); |
| 2085 } | 2082 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2147 return this; | 2144 return this; |
| 2148 } | 2145 } |
| 2149 | 2146 |
| 2150 // Note: using Function instead of 'eval' to get a clean scope. | 2147 // Note: using Function instead of 'eval' to get a clean scope. |
| 2151 // TODO(jmesserly): evaluate the performance of these stubs. | 2148 // TODO(jmesserly): evaluate the performance of these stubs. |
| 2152 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}'; | 2149 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}'; |
| 2153 return new Function('$f', 'return ' + f + '').call(null, this); | 2150 return new Function('$f', 'return ' + f + '').call(null, this); |
| 2154 | 2151 |
| 2155 } | 2152 } |
| 2156 // ********** Code for top level ************** | 2153 // ********** Code for top level ************** |
| 2154 function _constList(other) { | |
| 2155 other.__proto__ = ImmutableList.prototype; | |
| 2156 return other; | |
| 2157 } | |
| 2157 function _map(itemsAndKeys) { | 2158 function _map(itemsAndKeys) { |
| 2158 var ret = new LinkedHashMapImplementation(); | 2159 var ret = new LinkedHashMapImplementation(); |
| 2159 for (var i = (0); | 2160 for (var i = (0); |
| 2160 i < itemsAndKeys.get$length(); ) { | 2161 i < itemsAndKeys.get$length(); ) { |
| 2161 ret.$setindex(itemsAndKeys.$index(i++), itemsAndKeys.$index(i++)); | 2162 ret.$setindex(itemsAndKeys[i++], itemsAndKeys[i++]); |
| 2162 } | 2163 } |
| 2163 return ret; | 2164 return ret; |
| 2164 } | 2165 } |
| 2165 // ********** Library node ************** | 2166 // ********** Library node ************** |
| 2166 // ********** Code for Process ************** | 2167 // ********** Code for Process ************** |
| 2167 function Process(_process) { | 2168 function Process(_process) { |
| 2168 this.SIGSYS = "SIGSYS"; | 2169 this.SIGSYS = "SIGSYS"; |
| 2169 this.SIGALRM = "SIGALRM"; | 2170 this.SIGALRM = "SIGALRM"; |
| 2170 this.SIGXCPU = "SIGXCPU"; | 2171 this.SIGXCPU = "SIGXCPU"; |
| 2171 this.SIGTSTP = "SIGTSTP"; | 2172 this.SIGTSTP = "SIGTSTP"; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2312 } | 2313 } |
| 2313 function get$process() { | 2314 function get$process() { |
| 2314 return new Process(get$_process()); | 2315 return new Process(get$_process()); |
| 2315 } | 2316 } |
| 2316 // ********** Library file_system ************** | 2317 // ********** Library file_system ************** |
| 2317 // ********** Code for top level ************** | 2318 // ********** Code for top level ************** |
| 2318 function joinPaths(path1, path2) { | 2319 function joinPaths(path1, path2) { |
| 2319 var pieces = path1.split("/"); | 2320 var pieces = path1.split("/"); |
| 2320 var $$list = path2.split("/"); | 2321 var $$list = path2.split("/"); |
| 2321 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2322 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2322 var piece = $$list.$index($$i); | 2323 var piece = $$list[$$i]; |
| 2323 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last$0(), ". ") && $ne(pieces.last$0(), "..")) { | 2324 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last$0(), ". ") && $ne(pieces.last$0(), "..")) { |
| 2324 pieces.removeLast$0(); | 2325 pieces.removeLast$0(); |
| 2325 } | 2326 } |
| 2326 else if ($ne(piece, "")) { | 2327 else if ($ne(piece, "")) { |
| 2327 if (pieces.get$length() > (0) && $eq(pieces.last$0(), ".")) { | 2328 if (pieces.get$length() > (0) && $eq(pieces.last$0(), ".")) { |
| 2328 pieces.removeLast$0(); | 2329 pieces.removeLast$0(); |
| 2329 } | 2330 } |
| 2330 pieces.add$1(piece); | 2331 pieces.add$1(piece); |
| 2331 } | 2332 } |
| 2332 } | 2333 } |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2686 else { | 2687 else { |
| 2687 if (this.useWrap0) { | 2688 if (this.useWrap0) { |
| 2688 w.writeln("function $wrap_call$0(fn) { return fn; }"); | 2689 w.writeln("function $wrap_call$0(fn) { return fn; }"); |
| 2689 } | 2690 } |
| 2690 if (this.useWrap1) { | 2691 if (this.useWrap1) { |
| 2691 w.writeln("function $wrap_call$1(fn) { return fn; }"); | 2692 w.writeln("function $wrap_call$1(fn) { return fn; }"); |
| 2692 } | 2693 } |
| 2693 } | 2694 } |
| 2694 var $$list = orderValuesByKeys(this._usedOperators); | 2695 var $$list = orderValuesByKeys(this._usedOperators); |
| 2695 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2696 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2696 var opImpl = $$list.$index($$i); | 2697 var opImpl = $$list[$$i]; |
| 2697 w.writeln(opImpl); | 2698 w.writeln(opImpl); |
| 2698 } | 2699 } |
| 2699 if ($globals.world.dom != null) { | 2700 if ($globals.world.dom != null) { |
| 2700 this.ensureTypeNameOf(); | 2701 this.ensureTypeNameOf(); |
| 2701 w.writeln("Object.defineProperty(Object.prototype, \"get$typeName\", { value : Object.prototype.$typeNameOf, enumerable: false, writable: true, configurable: true});"); | 2702 w.writeln("Object.defineProperty(Object.prototype, \"get$typeName\", { value : Object.prototype.$typeNameOf, enumerable: false, writable: true, configurable: true});"); |
| 2702 } | 2703 } |
| 2703 } | 2704 } |
| 2704 CoreJs.prototype.generate$1 = CoreJs.prototype.generate; | 2705 CoreJs.prototype.generate$1 = CoreJs.prototype.generate; |
| 2705 // ********** Code for Element ************** | 2706 // ********** Code for Element ************** |
| 2706 function Element(name, _enclosingElement) { | 2707 function Element(name, _enclosingElement) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2739 Element.prototype.resolve = function() { | 2740 Element.prototype.resolve = function() { |
| 2740 | 2741 |
| 2741 } | 2742 } |
| 2742 Element.prototype.get$typeParameters = function() { | 2743 Element.prototype.get$typeParameters = function() { |
| 2743 return null; | 2744 return null; |
| 2744 } | 2745 } |
| 2745 Element.prototype.get$enclosingElement = function() { | 2746 Element.prototype.get$enclosingElement = function() { |
| 2746 return this._enclosingElement == null ? this.get$library() : this._enclosingEl ement; | 2747 return this._enclosingElement == null ? this.get$library() : this._enclosingEl ement; |
| 2747 } | 2748 } |
| 2748 Element.prototype.set$enclosingElement = function(e) { | 2749 Element.prototype.set$enclosingElement = function(e) { |
| 2749 return this._enclosingElement = e; | 2750 var $0; |
| 2751 return (this._enclosingElement = ($0 = e), $0); | |
| 2750 } | 2752 } |
| 2751 Element.prototype.resolveType = function(node, typeErrors) { | 2753 Element.prototype.resolveType = function(node, typeErrors) { |
| 2752 if (node == null) return $globals.world.varType; | 2754 if (node == null) return $globals.world.varType; |
| 2753 if (node.type != null) return node.type; | 2755 if (node.type != null) return node.type; |
| 2754 if ((node instanceof NameTypeReference)) { | 2756 if ((node instanceof NameTypeReference)) { |
| 2755 var typeRef = node; | 2757 var typeRef = node; |
| 2756 var name; | 2758 var name; |
| 2757 if (typeRef.names != null) { | 2759 if (typeRef.names != null) { |
| 2758 name = typeRef.names.last$0().get$name(); | 2760 name = typeRef.names.last().get$name(); |
| 2759 } | 2761 } |
| 2760 else { | 2762 else { |
| 2761 name = typeRef.name.name; | 2763 name = typeRef.name.name; |
| 2762 } | 2764 } |
| 2763 if (this.get$typeParameters() != null) { | 2765 if (this.get$typeParameters() != null) { |
| 2764 var $$list = this.get$typeParameters(); | 2766 var $$list = this.get$typeParameters(); |
| 2765 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2767 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2766 var tp = $$list.$index($$i); | 2768 var tp = $$list[$$i]; |
| 2767 if ($eq(tp.get$name(), name)) { | 2769 if ($eq(tp.get$name(), name)) { |
| 2768 typeRef.type = tp; | 2770 typeRef.type = tp; |
| 2769 } | 2771 } |
| 2770 } | 2772 } |
| 2771 } | 2773 } |
| 2772 if (typeRef.type != null) { | 2774 if (typeRef.type != null) { |
| 2773 return typeRef.type; | 2775 return typeRef.type; |
| 2774 } | 2776 } |
| 2775 return this.get$enclosingElement().resolveType$2(node, typeErrors); | 2777 return this.get$enclosingElement().resolveType$2(node, typeErrors); |
| 2776 } | 2778 } |
| 2777 else if ((node instanceof GenericTypeReference)) { | 2779 else if ((node instanceof GenericTypeReference)) { |
| 2778 var typeRef = node; | 2780 var typeRef = node; |
| 2779 var baseType = this.resolveType$2(typeRef.baseType, typeErrors); | 2781 var baseType = this.resolveType$2(typeRef.baseType, typeErrors); |
| 2780 if (!baseType.get$isGeneric()) { | 2782 if (!baseType.get$isGeneric()) { |
| 2781 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR ef.span); | 2783 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR ef.span); |
| 2782 return null; | 2784 return null; |
| 2783 } | 2785 } |
| 2784 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$ length()) { | 2786 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$ length()) { |
| 2785 $globals.world.error("wrong number of type arguments", typeRef.span); | 2787 $globals.world.error("wrong number of type arguments", typeRef.span); |
| 2786 return null; | 2788 return null; |
| 2787 } | 2789 } |
| 2788 var typeArgs = []; | 2790 var typeArgs = []; |
| 2789 for (var i = (0); | 2791 for (var i = (0); |
| 2790 i < typeRef.typeArguments.get$length(); i++) { | 2792 i < typeRef.typeArguments.get$length(); i++) { |
| 2791 typeArgs.add$1(this.resolveType$2(typeRef.typeArguments.$index(i), typeErr ors)); | 2793 typeArgs.add$1(this.resolveType$2(typeRef.typeArguments[i], typeErrors)); |
| 2792 } | 2794 } |
| 2793 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); | 2795 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); |
| 2794 } | 2796 } |
| 2795 else if ((node instanceof FunctionTypeReference)) { | 2797 else if ((node instanceof FunctionTypeReference)) { |
| 2796 var typeRef = node; | 2798 var typeRef = node; |
| 2797 var name = ""; | 2799 var name = ""; |
| 2798 if (typeRef.func.name != null) { | 2800 if (typeRef.func.name != null) { |
| 2799 name = typeRef.func.name.name; | 2801 name = typeRef.func.name.name; |
| 2800 } | 2802 } |
| 2801 typeRef.type = this.get$library().getOrAddFunctionType(this, name, typeRef.f unc); | 2803 typeRef.type = this.get$library().getOrAddFunctionType(this, name, typeRef.f unc); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 2825 this.markLibrariesUsed([$globals.world.coreimpl, $globals.world.corelib, thi s.main.declaringType.get$library()]); | 2827 this.markLibrariesUsed([$globals.world.coreimpl, $globals.world.corelib, thi s.main.declaringType.get$library()]); |
| 2826 } | 2828 } |
| 2827 $globals.world.numImplType.markUsed(); | 2829 $globals.world.numImplType.markUsed(); |
| 2828 $globals.world.stringImplType.markUsed(); | 2830 $globals.world.stringImplType.markUsed(); |
| 2829 if ($globals.world.corelib.types.$index("Isolate").get$isUsed() || $globals.wo rld.coreimpl.types.$index("ReceivePortImpl").get$isUsed()) { | 2831 if ($globals.world.corelib.types.$index("Isolate").get$isUsed() || $globals.wo rld.coreimpl.types.$index("ReceivePortImpl").get$isUsed()) { |
| 2830 if (this.corejs.useWrap0 || this.corejs.useWrap1) { | 2832 if (this.corejs.useWrap0 || this.corejs.useWrap1) { |
| 2831 this.genMethod($globals.world.coreimpl.types.$index("IsolateContext").getM ember$1("eval")); | 2833 this.genMethod($globals.world.coreimpl.types.$index("IsolateContext").getM ember$1("eval")); |
| 2832 this.genMethod($globals.world.coreimpl.types.$index("EventLoop").getMember $1("run")); | 2834 this.genMethod($globals.world.coreimpl.types.$index("EventLoop").getMember $1("run")); |
| 2833 } | 2835 } |
| 2834 this.corejs.useIsolates = true; | 2836 this.corejs.useIsolates = true; |
| 2835 var isolateMain = $globals.world.coreimpl.topType.resolveMember("startRootIs olate").members.$index((0)); | 2837 var isolateMain = $globals.world.coreimpl.lookup("startRootIsolate", this.ma in.get$span()); |
| 2836 var isolateMainTarget = new TypeValue($globals.world.coreimpl.topType, this. main.get$span()); | 2838 var isolateMainTarget = new TypeValue($globals.world.coreimpl.topType, this. main.get$span()); |
| 2837 mainCall = isolateMain.invoke(metaGen, null, isolateMainTarget, new Argument s(null, [this.main._get(metaGen, this.main.definition, null, false)]), false); | 2839 mainCall = isolateMain.invoke(metaGen, null, isolateMainTarget, new Argument s(null, [this.main._get(metaGen, this.main.definition, null, false)]), false); |
| 2838 } | 2840 } |
| 2839 this.writeTypes($globals.world.coreimpl); | 2841 this.writeTypes($globals.world.coreimpl); |
| 2840 this.writeTypes($globals.world.corelib); | 2842 this.writeTypes($globals.world.corelib); |
| 2841 this.writeTypes(this.main.declaringType.get$library()); | 2843 this.writeTypes(this.main.declaringType.get$library()); |
| 2842 if (this._mixins != null) this.writer.write(this._mixins.get$text()); | 2844 if (this._mixins != null) this.writer.write(this._mixins.get$text()); |
| 2843 this.writeDynamicDispatchMetadata(); | 2845 this.writeDynamicDispatchMetadata(); |
| 2844 this.writeGlobals(); | 2846 this.writeGlobals(); |
| 2845 this.writer.writeln(("" + mainCall.get$code() + ";")); | 2847 this.writer.writeln(("" + mainCall.get$code() + ";")); |
| 2846 } | 2848 } |
| 2847 WorldGenerator.prototype.markLibrariesUsed = function(libs) { | 2849 WorldGenerator.prototype.markLibrariesUsed = function(libs) { |
| 2848 return this.getAllTypes(libs).forEach(this.get$markTypeUsed()); | 2850 return this.getAllTypes(libs).forEach(this.get$markTypeUsed()); |
| 2849 } | 2851 } |
| 2850 WorldGenerator.prototype.markTypeUsed = function(type) { | 2852 WorldGenerator.prototype.markTypeUsed = function(type) { |
| 2851 if (!type.get$isClass()) return; | 2853 if (!type.get$isClass()) return; |
| 2852 type.markUsed(); | 2854 type.markUsed(); |
| 2853 type.isTested = true; | 2855 type.isTested = true; |
| 2854 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members ().getValues$0().every$1((function (m) { | 2856 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members ().getValues().every((function (m) { |
| 2855 return m.get$isStatic() && !m.get$isFactory(); | 2857 return m.get$isStatic() && !m.get$isFactory(); |
| 2856 }) | 2858 }) |
| 2857 )); | 2859 )); |
| 2858 var members = ListFactory.ListFactory$from$factory(type.get$members().getValue s$0()); | 2860 var members = ListFactory.ListFactory$from$factory(type.get$members().getValue s()); |
| 2859 members.addAll$1(type.get$constructors().getValues$0()); | 2861 members.addAll$1(type.get$constructors().getValues()); |
| 2860 type.get$factories().forEach((function (f) { | 2862 type.get$factories().forEach((function (f) { |
| 2861 return members.add$1(f); | 2863 return members.add$1(f); |
| 2862 }) | 2864 }) |
| 2863 ); | 2865 ); |
| 2864 for (var $$i = members.iterator$0(); $$i.hasNext$0(); ) { | 2866 for (var $$i = members.iterator$0(); $$i.hasNext$0(); ) { |
| 2865 var member = $$i.next$0(); | 2867 var member = $$i.next$0(); |
| 2866 if ((member instanceof PropertyMember)) { | 2868 if ((member instanceof PropertyMember)) { |
| 2867 if (member.get$getter() != null) this.genMethod(member.get$getter()); | 2869 if (member.get$getter() != null) this.genMethod(member.get$getter()); |
| 2868 if (member.get$setter() != null) this.genMethod(member.get$setter()); | 2870 if (member.get$setter() != null) this.genMethod(member.get$setter()); |
| 2869 } | 2871 } |
| 2870 if ((member instanceof MethodMember)) this.genMethod(member); | 2872 if ((member instanceof MethodMember)) this.genMethod(member); |
| 2871 } | 2873 } |
| 2872 } | 2874 } |
| 2873 WorldGenerator.prototype.get$markTypeUsed = function() { | 2875 WorldGenerator.prototype.get$markTypeUsed = function() { |
| 2874 return this.markTypeUsed.bind(this); | 2876 return this.markTypeUsed.bind(this); |
| 2875 } | 2877 } |
| 2876 WorldGenerator.prototype.getAllTypes = function(libs) { | 2878 WorldGenerator.prototype.getAllTypes = function(libs) { |
| 2877 var types = []; | 2879 var types = []; |
| 2878 var seen = new HashSetImplementation(); | 2880 var seen = new HashSetImplementation(); |
| 2879 for (var $$i = 0;$$i < libs.get$length(); $$i++) { | 2881 for (var $$i = 0;$$i < libs.get$length(); $$i++) { |
| 2880 var mainLib = libs.$index($$i); | 2882 var mainLib = libs[$$i]; |
| 2881 var toCheck = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([mainLib]); | 2883 var toCheck = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([mainLib]); |
| 2882 while (!toCheck.isEmpty()) { | 2884 while (!toCheck.isEmpty()) { |
| 2883 var lib = toCheck.removeFirst$0(); | 2885 var lib = toCheck.removeFirst(); |
| 2884 if (seen.contains(lib)) continue; | 2886 if (seen.contains(lib)) continue; |
| 2885 seen.add(lib); | 2887 seen.add(lib); |
| 2886 lib.get$imports().forEach$1((function (lib, toCheck, i) { | 2888 lib.get$imports().forEach$1((function (lib, toCheck, i) { |
| 2887 return toCheck.addLast(lib); | 2889 return toCheck.addLast(lib); |
| 2888 }).bind(null, lib, toCheck) | 2890 }).bind(null, lib, toCheck) |
| 2889 ); | 2891 ); |
| 2890 lib.get$types().getValues$0().forEach$1((function (t) { | 2892 lib.get$types().getValues$0().forEach$1((function (t) { |
| 2891 return types.add(t); | 2893 return types.add(t); |
| 2892 }) | 2894 }) |
| 2893 ); | 2895 ); |
| 2894 } | 2896 } |
| 2895 } | 2897 } |
| 2896 return types; | 2898 return types; |
| 2897 } | 2899 } |
| 2898 WorldGenerator.prototype.globalForStaticField = function(field, exp, dependencie s) { | 2900 WorldGenerator.prototype.globalForStaticField = function(field, exp, dependencie s) { |
| 2899 this.hasStatics = true; | 2901 this.hasStatics = true; |
| 2900 var key = ("" + field.declaringType.get$jsname() + "." + field.get$jsname()); | 2902 var key = ("" + field.declaringType.get$jsname() + "." + field.get$jsname()); |
| 2901 var ret = this.globals.$index(key); | 2903 var ret = this.globals.$index(key); |
| 2902 if (ret == null) { | 2904 if (ret == null) { |
| 2903 ret = new GlobalValue(exp.get$type(), exp.get$code(), field.isFinal, field, null, exp, exp.span, dependencies); | 2905 ret = new GlobalValue(exp.get$type(), exp.get$code(), field.isFinal, field, null, exp, exp.span, dependencies); |
| 2904 this.globals.$setindex(key, ret); | 2906 this.globals.$setindex(key, ret); |
| 2905 } | 2907 } |
| 2906 return ret; | 2908 return ret; |
| 2907 } | 2909 } |
| 2908 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { | 2910 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { |
| 2909 var key = exp.get$type().get$jsname() + ":" + exp.get$code(); | 2911 var key = exp.get$type().get$jsname() + ":" + exp.get$code(); |
| 2910 var ret = this.globals.$index(key); | 2912 var ret = this.globals.$index(key); |
| 2911 if (ret == null) { | 2913 if (ret == null) { |
| 2912 var ns = this.globals.get$length().toString(); | 2914 var ns = this.globals.get$length().toString$0(); |
| 2913 while (ns.get$length() < (4)) ns = "0" + ns; | 2915 while (ns.get$length() < (4)) ns = "0" + ns; |
| 2914 var name = ("const$" + ns); | 2916 var name = ("const$" + ns); |
| 2915 ret = new GlobalValue(exp.get$type(), name, true, null, name, exp, exp.span, dependencies); | 2917 ret = new GlobalValue(exp.get$type(), name, true, null, name, exp, exp.span, dependencies); |
| 2916 this.globals.$setindex(key, ret); | 2918 this.globals.$setindex(key, ret); |
| 2917 } | 2919 } |
| 2918 return ret; | 2920 return ret; |
| 2919 } | 2921 } |
| 2920 WorldGenerator.prototype.writeTypes = function(lib) { | 2922 WorldGenerator.prototype.writeTypes = function(lib) { |
| 2921 if (lib.isWritten) return; | 2923 if (lib.isWritten) return; |
| 2922 lib.isWritten = true; | 2924 lib.isWritten = true; |
| 2923 var $$list = lib.imports; | 2925 var $$list = lib.imports; |
| 2924 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2926 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2925 var import_ = $$list.$index($$i); | 2927 var import_ = $$list[$$i]; |
| 2926 this.writeTypes(import_.get$library()); | 2928 this.writeTypes(import_.get$library()); |
| 2927 } | 2929 } |
| 2928 for (var i = (0); | 2930 for (var i = (0); |
| 2929 i < lib.sources.get$length(); i++) { | 2931 i < lib.sources.get$length(); i++) { |
| 2930 lib.sources.$index(i).set$orderInLibrary(i); | 2932 lib.sources[i].set$orderInLibrary(i); |
| 2931 } | 2933 } |
| 2932 this.writer.comment(("// ********** Library " + lib.name + " **************") ); | 2934 this.writer.comment(("// ********** Library " + lib.name + " **************") ); |
| 2933 if (lib.get$isCore()) { | 2935 if (lib.get$isCore()) { |
| 2934 this.writer.comment("// ********** Natives dart:core **************"); | 2936 this.writer.comment("// ********** Natives dart:core **************"); |
| 2935 this.corejs.generate(this.writer); | 2937 this.corejs.generate(this.writer); |
| 2936 } | 2938 } |
| 2937 var $$list = lib.natives; | 2939 var $$list = lib.natives; |
| 2938 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2940 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2939 var file = $$list.$index($$i); | 2941 var file = $$list[$$i]; |
| 2940 var filename = basename(file.get$filename()); | 2942 var filename = basename(file.get$filename()); |
| 2941 this.writer.comment(("// ********** Natives " + filename + " ************** ")); | 2943 this.writer.comment(("// ********** Natives " + filename + " ************** ")); |
| 2942 this.writer.writeln(file.get$text()); | 2944 this.writer.writeln(file.get$text()); |
| 2943 } | 2945 } |
| 2944 lib.topType.markUsed(); | 2946 lib.topType.markUsed(); |
| 2945 var $$list = this._orderValues(lib.types); | 2947 var orderedTypes = this._orderValues(lib.types); |
| 2946 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2948 for (var $$i = orderedTypes.iterator$0(); $$i.hasNext$0(); ) { |
| 2947 var type = $$list.$index($$i); | 2949 var type = $$i.next$0(); |
| 2948 if ((type.get$isUsed() || type.get$library().get$isDom() || type.get$isHidde nNativeType()) && type.get$isClass()) { | 2950 if ((type.get$library().get$isDom() || type.get$isHiddenNativeType()) && typ e.get$isClass()) { |
| 2951 type.markUsed$0(); | |
| 2952 } | |
| 2953 } | |
| 2954 for (var $$i = orderedTypes.iterator$0(); $$i.hasNext$0(); ) { | |
| 2955 var type = $$i.next$0(); | |
| 2956 if (type.get$isUsed() && type.get$isClass()) { | |
| 2949 this.writeType(type); | 2957 this.writeType(type); |
| 2950 if (type.get$isGeneric()) { | 2958 if (type.get$isGeneric()) { |
| 2951 var $list0 = this._orderValues(type.get$_concreteTypes()); | 2959 var $$list = this._orderValues(type.get$_concreteTypes()); |
| 2952 for (var $i0 = 0;$i0 < $list0.get$length(); $i0++) { | 2960 for (var $i0 = 0;$i0 < $$list.get$length(); $i0++) { |
| 2953 var ct = $list0.$index($i0); | 2961 var ct = $$list[$i0]; |
| 2954 this.writeType(ct); | 2962 this.writeType(ct); |
| 2955 } | 2963 } |
| 2956 } | 2964 } |
| 2957 } | 2965 } |
| 2958 else if (type.get$isFunction() && type.get$varStubs().get$length() > (0)) { | 2966 else if (type.get$isFunction() && type.get$varStubs().get$length() > (0)) { |
| 2959 this.writer.comment(("// ********** Code for " + type.get$jsname() + " *** ***********")); | 2967 this.writer.comment(("// ********** Code for " + type.get$jsname() + " *** ***********")); |
| 2960 this._writeDynamicStubs(type); | 2968 this._writeDynamicStubs(type); |
| 2961 } | 2969 } |
| 2962 if (type.get$typeCheckCode() != null) { | 2970 if (type.get$typeCheckCode() != null) { |
| 2963 this.writer.writeln(type.get$typeCheckCode()); | 2971 this.writer.writeln(type.get$typeCheckCode()); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3078 else { | 3086 else { |
| 3079 var standardConstructor = type.get$constructors().$index(""); | 3087 var standardConstructor = type.get$constructors().$index(""); |
| 3080 if (standardConstructor == null || standardConstructor.generator == null) { | 3088 if (standardConstructor == null || standardConstructor.generator == null) { |
| 3081 if (!type.get$isNative()) { | 3089 if (!type.get$isNative()) { |
| 3082 this.writer.writeln(("function " + type.get$jsname() + "() {}")); | 3090 this.writer.writeln(("function " + type.get$jsname() + "() {}")); |
| 3083 } | 3091 } |
| 3084 } | 3092 } |
| 3085 else { | 3093 else { |
| 3086 standardConstructor.generator.writeDefinition(this.writer, null); | 3094 standardConstructor.generator.writeDefinition(this.writer, null); |
| 3087 } | 3095 } |
| 3088 var $$list = type.get$constructors().getValues$0(); | 3096 var $$list = type.get$constructors().getValues(); |
| 3089 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3097 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3090 var c = $$i.next$0(); | 3098 var c = $$i.next$0(); |
| 3091 if (c.get$generator() != null && $ne(c, standardConstructor)) { | 3099 if (c.get$generator() != null && $ne(c, standardConstructor)) { |
| 3092 c.get$generator().writeDefinition$2(this.writer); | 3100 c.get$generator().writeDefinition$2(this.writer); |
| 3093 } | 3101 } |
| 3094 } | 3102 } |
| 3095 } | 3103 } |
| 3096 if (!(type instanceof ConcreteType)) { | 3104 if (!(type instanceof ConcreteType)) { |
| 3097 this._maybeIsTest(type, type); | 3105 this._maybeIsTest(type, type); |
| 3098 } | 3106 } |
| 3099 if (type.get$genericType()._concreteTypes != null) { | 3107 if (type.get$genericType()._concreteTypes != null) { |
| 3100 var $$list = this._orderValues(type.get$genericType()._concreteTypes); | 3108 var $$list = this._orderValues(type.get$genericType()._concreteTypes); |
| 3101 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3109 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3102 var ct = $$list.$index($$i); | 3110 var ct = $$list[$$i]; |
| 3103 this._maybeIsTest(type, ct); | 3111 this._maybeIsTest(type, ct); |
| 3104 } | 3112 } |
| 3105 } | 3113 } |
| 3106 if (type.get$interfaces() != null) { | 3114 if (type.get$interfaces() != null) { |
| 3107 var seen = new HashSetImplementation(); | 3115 var seen = new HashSetImplementation(); |
| 3108 var worklist = []; | 3116 var worklist = []; |
| 3109 worklist.addAll$1(type.get$interfaces()); | 3117 worklist.addAll$1(type.get$interfaces()); |
| 3110 seen.addAll$1(type.get$interfaces()); | 3118 seen.addAll$1(type.get$interfaces()); |
| 3111 while (!worklist.isEmpty$0()) { | 3119 while (!worklist.isEmpty$0()) { |
| 3112 var interface_ = worklist.removeLast$0(); | 3120 var interface_ = worklist.removeLast$0(); |
| 3113 this._maybeIsTest(type, interface_.get$genericType()); | 3121 this._maybeIsTest(type, interface_.get$genericType()); |
| 3114 if (interface_.get$genericType().get$_concreteTypes() != null) { | 3122 if (interface_.get$genericType().get$_concreteTypes() != null) { |
| 3115 var $$list = this._orderValues(interface_.get$genericType().get$_concret eTypes()); | 3123 var $$list = this._orderValues(interface_.get$genericType().get$_concret eTypes()); |
| 3116 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3124 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3117 var ct = $$list.$index($$i); | 3125 var ct = $$list[$$i]; |
| 3118 this._maybeIsTest(type, ct); | 3126 this._maybeIsTest(type, ct); |
| 3119 } | 3127 } |
| 3120 } | 3128 } |
| 3121 var $$list = interface_.get$interfaces(); | 3129 var $$list = interface_.get$interfaces(); |
| 3122 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3130 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3123 var other = $$i.next$0(); | 3131 var other = $$i.next$0(); |
| 3124 if (!seen.contains$1(other)) { | 3132 if (!seen.contains$1(other)) { |
| 3125 worklist.addLast$1(other); | 3133 worklist.addLast$1(other); |
| 3126 seen.add$1(other); | 3134 seen.add$1(other); |
| 3127 } | 3135 } |
| 3128 } | 3136 } |
| 3129 } | 3137 } |
| 3130 } | 3138 } |
| 3131 type.get$factories().forEach(this.get$_writeMethod()); | 3139 type.get$factories().forEach(this.get$_writeMethod()); |
| 3132 var $$list = this._orderValues(type.get$members()); | 3140 var $$list = this._orderValues(type.get$members()); |
| 3133 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3141 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3134 var member = $$list.$index($$i); | 3142 var member = $$list[$$i]; |
| 3135 if ((member instanceof FieldMember)) { | 3143 if ((member instanceof FieldMember)) { |
| 3136 this._writeField(member); | 3144 this._writeField(member); |
| 3137 } | 3145 } |
| 3138 if ((member instanceof PropertyMember)) { | 3146 if ((member instanceof PropertyMember)) { |
| 3139 this._writeProperty(member); | 3147 this._writeProperty(member); |
| 3140 } | 3148 } |
| 3141 if (member.get$isMethod()) { | 3149 if (member.get$isMethod()) { |
| 3142 this._writeMethod(member); | 3150 this._writeMethod(member); |
| 3143 } | 3151 } |
| 3144 } | 3152 } |
| 3145 this._writeDynamicStubs(type); | 3153 this._writeDynamicStubs(type); |
| 3146 } | 3154 } |
| 3147 WorldGenerator.prototype._typeNeedsHolderForStaticMethods = function(type) { | 3155 WorldGenerator.prototype._typeNeedsHolderForStaticMethods = function(type) { |
| 3148 var $$list = type.get$members().getValues$0(); | 3156 var $$list = type.get$members().getValues(); |
| 3149 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3157 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3150 var member = $$i.next$0(); | 3158 var member = $$i.next$0(); |
| 3151 if (member.get$isMethod()) { | 3159 if (member.get$isMethod()) { |
| 3152 if (member.get$isConstructor() || member.get$isStatic()) { | 3160 if (member.get$isConstructor() || member.get$isStatic()) { |
| 3153 if (member.get$isGenerated()) { | 3161 if (member.get$isGenerated()) { |
| 3154 return true; | 3162 return true; |
| 3155 } | 3163 } |
| 3156 } | 3164 } |
| 3157 } | 3165 } |
| 3158 } | 3166 } |
| 3159 return false; | 3167 return false; |
| 3160 } | 3168 } |
| 3161 WorldGenerator.prototype._ensureInheritMembersHelper = function() { | 3169 WorldGenerator.prototype._ensureInheritMembersHelper = function() { |
| 3162 if (this._mixins != null) return; | 3170 if (this._mixins != null) return; |
| 3163 this._mixins = new CodeWriter(); | 3171 this._mixins = new CodeWriter(); |
| 3164 this._mixins.comment("// ********** Generic Type Inheritance **************"); | 3172 this._mixins.comment("// ********** Generic Type Inheritance **************"); |
| 3165 this._mixins.writeln("/** Implements extends for generic types. */\nfunction $ inheritsMembers(child, parent) {\n child = child.prototype;\n parent = parent. prototype;\n Object.getOwnPropertyNames(parent).forEach(function(name) {\n i f (typeof(child[name]) == 'undefined') child[name] = parent[name];\n });\n}"); | 3173 this._mixins.writeln("/** Implements extends for generic types. */\nfunction $ inheritsMembers(child, parent) {\n child = child.prototype;\n parent = parent. prototype;\n Object.getOwnPropertyNames(parent).forEach(function(name) {\n i f (typeof(child[name]) == 'undefined') child[name] = parent[name];\n });\n}"); |
| 3166 } | 3174 } |
| 3167 WorldGenerator.prototype._writeDynamicStubs = function(type) { | 3175 WorldGenerator.prototype._writeDynamicStubs = function(type) { |
| 3168 var $$list = orderValuesByKeys(type.varStubs); | 3176 var $$list = orderValuesByKeys(type.varStubs); |
| 3169 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3177 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3170 var stub = $$list.$index($$i); | 3178 var stub = $$list[$$i]; |
| 3171 if (!stub.get$isGenerated()) stub.generate$1(this.writer); | 3179 if (!stub.get$isGenerated()) stub.generate$1(this.writer); |
| 3172 } | 3180 } |
| 3173 } | 3181 } |
| 3174 WorldGenerator.prototype._writeStaticField = function(field) { | 3182 WorldGenerator.prototype._writeStaticField = function(field) { |
| 3175 if (field.isFinal) return; | 3183 if (field.isFinal) return; |
| 3176 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ()); | 3184 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname ()); |
| 3177 if (this.globals.containsKey(fullname)) { | 3185 if (this.globals.containsKey(fullname)) { |
| 3178 var value = this.globals.$index(fullname); | 3186 var value = this.globals.$index(fullname); |
| 3179 if (field.declaringType.get$isTop() && !field.isNative) { | 3187 if (field.declaringType.get$isTop() && !field.isNative) { |
| 3180 this.writer.writeln(("$globals." + field.get$jsname() + " = " + value.get$ exp().get$code() + ";")); | 3188 this.writer.writeln(("$globals." + field.get$jsname() + " = " + value.get$ exp().get$code() + ";")); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3217 else if ((m instanceof MethodMember) && m.get$isNative() && m._provideProperty Syntax && !m._provideFieldSyntax) { | 3225 else if ((m instanceof MethodMember) && m.get$isNative() && m._provideProperty Syntax && !m._provideFieldSyntax) { |
| 3218 MethodGenerator._maybeGenerateBoundGetter(m, this.writer); | 3226 MethodGenerator._maybeGenerateBoundGetter(m, this.writer); |
| 3219 } | 3227 } |
| 3220 } | 3228 } |
| 3221 WorldGenerator.prototype.get$_writeMethod = function() { | 3229 WorldGenerator.prototype.get$_writeMethod = function() { |
| 3222 return this._writeMethod.bind(this); | 3230 return this._writeMethod.bind(this); |
| 3223 } | 3231 } |
| 3224 WorldGenerator.prototype.writeGlobals = function() { | 3232 WorldGenerator.prototype.writeGlobals = function() { |
| 3225 if (this.globals.get$length() > (0)) { | 3233 if (this.globals.get$length() > (0)) { |
| 3226 this.writer.comment("// ********** Globals **************"); | 3234 this.writer.comment("// ********** Globals **************"); |
| 3227 var list = this.globals.getValues$0(); | 3235 var list = this.globals.getValues(); |
| 3228 list.sort$1((function (a, b) { | 3236 list.sort$1((function (a, b) { |
| 3229 return a.compareTo$1(b); | 3237 return a.compareTo$1(b); |
| 3230 }) | 3238 }) |
| 3231 ); | 3239 ); |
| 3232 this.writer.enterBlock("function $static_init(){"); | 3240 this.writer.enterBlock("function $static_init(){"); |
| 3233 for (var $$i = list.iterator$0(); $$i.hasNext$0(); ) { | 3241 for (var $$i = list.iterator$0(); $$i.hasNext$0(); ) { |
| 3234 var global = $$i.next$0(); | 3242 var global = $$i.next$0(); |
| 3235 if (global.get$field() != null) { | 3243 if (global.get$field() != null) { |
| 3236 this._writeStaticField(global.get$field()); | 3244 this._writeStaticField(global.get$field()); |
| 3237 } | 3245 } |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 3261 var $this = this; // closure support | 3269 var $this = this; // closure support |
| 3262 if (this.typesWithDynamicDispatch == null) return; | 3270 if (this.typesWithDynamicDispatch == null) return; |
| 3263 this.writer.comment(("// " + this.typesWithDynamicDispatch.get$length() + " dy namic types.")); | 3271 this.writer.comment(("// " + this.typesWithDynamicDispatch.get$length() + " dy namic types.")); |
| 3264 var seen = new HashSetImplementation(); | 3272 var seen = new HashSetImplementation(); |
| 3265 var types = []; | 3273 var types = []; |
| 3266 function visit(type) { | 3274 function visit(type) { |
| 3267 if (seen.contains$1(type)) return; | 3275 if (seen.contains$1(type)) return; |
| 3268 seen.add$1(type); | 3276 seen.add$1(type); |
| 3269 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); | 3277 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); |
| 3270 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3278 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3271 var subtype = $$list.$index($$i); | 3279 var subtype = $$list[$$i]; |
| 3272 visit(subtype); | 3280 visit.call$1(subtype); |
| 3273 } | 3281 } |
| 3274 types.add$1(type); | 3282 types.add$1(type); |
| 3275 } | 3283 } |
| 3276 var $$list = this._orderCollectionValues(this.typesWithDynamicDispatch); | 3284 var $$list = this._orderCollectionValues(this.typesWithDynamicDispatch); |
| 3277 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3285 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3278 var type = $$list.$index($$i); | 3286 var type = $$list[$$i]; |
| 3279 visit(type); | 3287 visit.call$1(type); |
| 3280 } | 3288 } |
| 3281 var dispatchTypes = types.filter$1((function (type) { | 3289 var dispatchTypes = types.filter$1((function (type) { |
| 3282 return !type.get$directSubtypes().isEmpty$0() && $this.typesWithDynamicDispa tch.contains(type); | 3290 return !type.get$directSubtypes().isEmpty$0() && $this.typesWithDynamicDispa tch.contains(type); |
| 3283 }) | 3291 }) |
| 3284 ); | 3292 ); |
| 3285 this.writer.comment(("// " + types.get$length() + " types")); | 3293 this.writer.comment(("// " + types.get$length() + " types")); |
| 3286 this.writer.comment(("// " + types.filter$1((function (t) { | 3294 this.writer.comment(("// " + types.filter$1((function (t) { |
| 3287 return !t.get$directSubtypes().isEmpty$0(); | 3295 return !t.get$directSubtypes().isEmpty$0(); |
| 3288 }) | 3296 }) |
| 3289 ).get$length() + " !leaf")); | 3297 ).get$length() + " !leaf")); |
| 3290 var varNames = []; | 3298 var varNames = []; |
| 3291 var varDefns = new HashMapImplementation(); | 3299 var varDefns = new HashMapImplementation(); |
| 3292 var tagDefns = new HashMapImplementation(); | 3300 var tagDefns = new HashMapImplementation(); |
| 3293 function makeExpression(type) { | 3301 function makeExpression(type) { |
| 3294 var expressions = []; | 3302 var expressions = []; |
| 3295 var subtags = [type.get$nativeName()]; | 3303 var subtags = [type.get$nativeName()]; |
| 3296 function walk(type) { | 3304 function walk(type) { |
| 3297 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); | 3305 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); |
| 3298 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3306 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3299 var subtype = $$list.$index($$i); | 3307 var subtype = $$list[$$i]; |
| 3300 var tag = subtype.get$nativeName(); | 3308 var tag = subtype.get$nativeName(); |
| 3301 var existing = tagDefns.$index(tag); | 3309 var existing = tagDefns.$index(tag); |
| 3302 if (existing == null) { | 3310 if (existing == null) { |
| 3303 subtags.add$1(tag); | 3311 subtags.add$1(tag); |
| 3304 walk(subtype); | 3312 walk.call$1(subtype); |
| 3305 } | 3313 } |
| 3306 else { | 3314 else { |
| 3307 if (varDefns.containsKey$1(existing)) { | 3315 if (varDefns.containsKey$1(existing)) { |
| 3308 expressions.add$1(existing); | 3316 expressions.add$1(existing); |
| 3309 } | 3317 } |
| 3310 else { | 3318 else { |
| 3311 var varName = ("v" + varNames.get$length() + "/*" + tag + "*/"); | 3319 var varName = ("v" + varNames.get$length() + "/*" + tag + "*/"); |
| 3312 varNames.add$1(varName); | 3320 varNames.add$1(varName); |
| 3313 varDefns.$setindex(varName, existing); | 3321 varDefns.$setindex(varName, existing); |
| 3314 tagDefns.$setindex(tag, varName); | 3322 tagDefns.$setindex(tag, varName); |
| 3315 expressions.add$1(varName); | 3323 expressions.add$1(varName); |
| 3316 } | 3324 } |
| 3317 } | 3325 } |
| 3318 } | 3326 } |
| 3319 } | 3327 } |
| 3320 walk(type); | 3328 walk.call$1(type); |
| 3321 var constantPart = ("'" + Strings.join(subtags, "|") + "'"); | 3329 var constantPart = ("'" + Strings.join(subtags, "|") + "'"); |
| 3322 if ($ne(constantPart, "''")) expressions.add$1(constantPart); | 3330 if ($ne(constantPart, "''")) expressions.add$1(constantPart); |
| 3323 var expression; | 3331 var expression; |
| 3324 if ($eq(expressions.get$length(), (1))) { | 3332 if ($eq(expressions.get$length(), (1))) { |
| 3325 expression = expressions.$index((0)); | 3333 expression = expressions.$index((0)); |
| 3326 } | 3334 } |
| 3327 else { | 3335 else { |
| 3328 expression = ("[" + Strings.join(expressions, ",") + "].join('|')"); | 3336 expression = ("[" + Strings.join(expressions, ",") + "].join('|')"); |
| 3329 } | 3337 } |
| 3330 return expression; | 3338 return expression; |
| 3331 } | 3339 } |
| 3332 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { | 3340 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { |
| 3333 var type = $$i.next$0(); | 3341 var type = $$i.next$0(); |
| 3334 tagDefns.$setindex(type.get$nativeName(), makeExpression(type)); | 3342 tagDefns.$setindex(type.get$nativeName(), makeExpression.call$1(type)); |
| 3335 } | 3343 } |
| 3336 if (!tagDefns.isEmpty$0()) { | 3344 if (!tagDefns.isEmpty$0()) { |
| 3337 this.writer.enterBlock("(function(){"); | 3345 this.writer.enterBlock("(function(){"); |
| 3338 for (var $$i = varNames.iterator$0(); $$i.hasNext$0(); ) { | 3346 for (var $$i = varNames.iterator$0(); $$i.hasNext$0(); ) { |
| 3339 var varName = $$i.next$0(); | 3347 var varName = $$i.next$0(); |
| 3340 this.writer.writeln(("var " + varName + " = " + varDefns.$index(varName) + ";")); | 3348 this.writer.writeln(("var " + varName + " = " + varDefns.$index(varName) + ";")); |
| 3341 } | 3349 } |
| 3342 this.writer.enterBlock("var table = ["); | 3350 this.writer.enterBlock("var table = ["); |
| 3343 this.writer.comment("// [dynamic-dispatch-tag, tags of classes implementing dynamic-dispatch-tag]"); | 3351 this.writer.comment("// [dynamic-dispatch-tag, tags of classes implementing dynamic-dispatch-tag]"); |
| 3344 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { | 3352 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3409 } | 3417 } |
| 3410 MethodGenerator.prototype.get$isStatic = function() { | 3418 MethodGenerator.prototype.get$isStatic = function() { |
| 3411 return this.method.get$isStatic(); | 3419 return this.method.get$isStatic(); |
| 3412 } | 3420 } |
| 3413 MethodGenerator.prototype.getTemp = function(value) { | 3421 MethodGenerator.prototype.getTemp = function(value) { |
| 3414 return value.get$needsTemp() ? this.forceTemp(value) : value; | 3422 return value.get$needsTemp() ? this.forceTemp(value) : value; |
| 3415 } | 3423 } |
| 3416 MethodGenerator.prototype.forceTemp = function(value) { | 3424 MethodGenerator.prototype.forceTemp = function(value) { |
| 3417 var name; | 3425 var name; |
| 3418 if (this._freeTemps.get$length() > (0)) { | 3426 if (this._freeTemps.get$length() > (0)) { |
| 3419 name = this._freeTemps.removeLast$0(); | 3427 name = this._freeTemps.removeLast(); |
| 3420 } | 3428 } |
| 3421 else { | 3429 else { |
| 3422 name = "$" + this._usedTemps.get$length(); | 3430 name = "$" + this._usedTemps.get$length(); |
| 3423 } | 3431 } |
| 3424 this._usedTemps.add(name); | 3432 this._usedTemps.add(name); |
| 3425 return new VariableValue(value.get$staticType(), name, value.span, false, valu e); | 3433 return new VariableValue(value.get$staticType(), name, value.span, false, valu e); |
| 3426 } | 3434 } |
| 3427 MethodGenerator.prototype.assignTemp = function(tmp, v) { | 3435 MethodGenerator.prototype.assignTemp = function(tmp, v) { |
| 3428 if ($eq(tmp, v)) { | 3436 if ($eq(tmp, v)) { |
| 3429 return v; | 3437 return v; |
| 3430 } | 3438 } |
| 3431 else { | 3439 else { |
| 3432 return new Value(v.get$type(), ("(" + tmp.get$code() + " = " + v.get$code() + ")"), v.span); | 3440 return new Value(v.get$type(), ("(" + tmp.get$code() + " = " + v.get$code() + ")"), v.span); |
| 3433 } | 3441 } |
| 3434 } | 3442 } |
| 3435 MethodGenerator.prototype.freeTemp = function(value) { | 3443 MethodGenerator.prototype.freeTemp = function(value) { |
| 3436 if (this._usedTemps.remove(value.code)) { | 3444 |
| 3437 this._freeTemps.add(value.code); | |
| 3438 } | |
| 3439 else { | |
| 3440 $globals.world.internalError(("tried to free unused value or non-temp \"" + value.code + "\"")); | |
| 3441 } | |
| 3442 } | 3445 } |
| 3443 MethodGenerator.prototype.run = function() { | 3446 MethodGenerator.prototype.run = function() { |
| 3444 if (this.method.isGenerated) return; | 3447 if (this.method.isGenerated) return; |
| 3445 this.method.isGenerated = true; | 3448 this.method.isGenerated = true; |
| 3446 this.method.generator = this; | 3449 this.method.generator = this; |
| 3447 var thisObject; | 3450 var thisObject; |
| 3448 if (this.method.get$isConstructor()) { | 3451 if (this.method.get$isConstructor()) { |
| 3449 thisObject = new ObjectValue(false, this.method.declaringType, this.method.g et$span()); | 3452 thisObject = new ObjectValue(false, this.method.declaringType, this.method.g et$span()); |
| 3450 thisObject.initFields$0(); | 3453 thisObject.initFields$0(); |
| 3451 } | 3454 } |
| 3452 else { | 3455 else { |
| 3453 thisObject = new Value(this.method.declaringType, "this", null); | 3456 thisObject = new Value(this.method.declaringType, "this", null); |
| 3454 } | 3457 } |
| 3455 var values = []; | 3458 var values = []; |
| 3456 var $$list = this.method.get$parameters(); | 3459 var $$list = this.method.get$parameters(); |
| 3457 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3460 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3458 var p = $$list.$index($$i); | 3461 var p = $$list[$$i]; |
| 3459 values.add$1(new Value(p.get$type(), p.get$name(), null)); | 3462 values.add$1(new Value(p.get$type(), p.get$name(), null)); |
| 3460 } | 3463 } |
| 3461 var args = new Arguments(null, values); | 3464 var args = new Arguments(null, values); |
| 3462 this.evalBody(thisObject, args); | 3465 this.evalBody(thisObject, args); |
| 3463 if (this.method.get$definition().get$nativeBody() != null) { | 3466 if (this.method.get$definition().get$nativeBody() != null) { |
| 3464 this.writer = new CodeWriter(); | 3467 this.writer = new CodeWriter(); |
| 3465 if ($eq(this.method.get$definition().get$nativeBody(), "")) { | 3468 if ($eq(this.method.get$definition().get$nativeBody(), "")) { |
| 3466 this.method.generator = null; | 3469 this.method.generator = null; |
| 3467 } | 3470 } |
| 3468 else { | 3471 else { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3566 } | 3569 } |
| 3567 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { | 3570 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { |
| 3568 if ((this.method instanceof MethodMember)) { | 3571 if ((this.method instanceof MethodMember)) { |
| 3569 var meth = this.method; | 3572 var meth = this.method; |
| 3570 if (meth._provideOptionalParamInfo) { | 3573 if (meth._provideOptionalParamInfo) { |
| 3571 var optNames = []; | 3574 var optNames = []; |
| 3572 var optValues = []; | 3575 var optValues = []; |
| 3573 meth.genParameterValues(); | 3576 meth.genParameterValues(); |
| 3574 var $$list = meth.parameters; | 3577 var $$list = meth.parameters; |
| 3575 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3578 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3576 var param = $$list.$index($$i); | 3579 var param = $$list[$$i]; |
| 3577 if (param.get$isOptional()) { | 3580 if (param.get$isOptional()) { |
| 3578 optNames.add$1(param.get$name()); | 3581 optNames.add$1(param.get$name()); |
| 3579 optValues.add$1(MethodGenerator._escapeString(param.get$value().get$co de())); | 3582 optValues.add$1(MethodGenerator._escapeString(param.get$value().get$co de())); |
| 3580 } | 3583 } |
| 3581 } | 3584 } |
| 3582 if (optNames.get$length() > (0)) { | 3585 if (optNames.get$length() > (0)) { |
| 3583 var start = ""; | 3586 var start = ""; |
| 3584 if (meth.isStatic) { | 3587 if (meth.isStatic) { |
| 3585 if (!meth.declaringType.get$isTop()) { | 3588 if (!meth.declaringType.get$isTop()) { |
| 3586 start = meth.declaringType.get$jsname() + "."; | 3589 start = meth.declaringType.get$jsname() + "."; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 3607 return newObject.setField(field, value, true); | 3610 return newObject.setField(field, value, true); |
| 3608 } | 3611 } |
| 3609 MethodGenerator.prototype.evalBody = function(newObject, args) { | 3612 MethodGenerator.prototype.evalBody = function(newObject, args) { |
| 3610 var fieldsSet = false; | 3613 var fieldsSet = false; |
| 3611 if (this.method.get$isNative() && this.method.get$isConstructor() && (newObjec t instanceof ObjectValue)) { | 3614 if (this.method.get$isNative() && this.method.get$isConstructor() && (newObjec t instanceof ObjectValue)) { |
| 3612 newObject.get$dynamic().set$seenNativeInitializer(true); | 3615 newObject.get$dynamic().set$seenNativeInitializer(true); |
| 3613 } | 3616 } |
| 3614 this._paramCode = []; | 3617 this._paramCode = []; |
| 3615 for (var i = (0); | 3618 for (var i = (0); |
| 3616 i < this.method.get$parameters().get$length(); i++) { | 3619 i < this.method.get$parameters().get$length(); i++) { |
| 3617 var p = this.method.get$parameters().$index(i); | 3620 var p = this.method.get$parameters()[i]; |
| 3618 var currentArg = null; | 3621 var currentArg = null; |
| 3619 if (i < args.get$bareCount()) { | 3622 if (i < args.get$bareCount()) { |
| 3620 currentArg = args.values.$index(i); | 3623 currentArg = args.values[i]; |
| 3621 } | 3624 } |
| 3622 else { | 3625 else { |
| 3623 currentArg = args.getValue(p.get$name()); | 3626 currentArg = args.getValue(p.get$name()); |
| 3624 if (currentArg == null) { | 3627 if (currentArg == null) { |
| 3625 p.genValue$2(this.method, this.method.generator); | 3628 p.genValue$2(this.method, this.method.generator); |
| 3626 currentArg = p.get$value(); | 3629 currentArg = p.get$value(); |
| 3627 } | 3630 } |
| 3628 } | 3631 } |
| 3629 if (p.get$isInitializer()) { | 3632 if (p.get$isInitializer()) { |
| 3630 this._paramCode.add(p.get$name()); | 3633 this._paramCode.add(p.get$name()); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3753 var value = m.invoke$4(this, node, target, newArgs); | 3756 var value = m.invoke$4(this, node, target, newArgs); |
| 3754 if ($ne(target.get$type(), $globals.world.objectType)) { | 3757 if ($ne(target.get$type(), $globals.world.objectType)) { |
| 3755 this.writer.writeln(("" + value.get$code() + ";")); | 3758 this.writer.writeln(("" + value.get$code() + ";")); |
| 3756 } | 3759 } |
| 3757 } | 3760 } |
| 3758 } | 3761 } |
| 3759 MethodGenerator.prototype._makeArgs = function(arguments) { | 3762 MethodGenerator.prototype._makeArgs = function(arguments) { |
| 3760 var args = []; | 3763 var args = []; |
| 3761 var seenLabel = false; | 3764 var seenLabel = false; |
| 3762 for (var $$i = 0;$$i < arguments.get$length(); $$i++) { | 3765 for (var $$i = 0;$$i < arguments.get$length(); $$i++) { |
| 3763 var arg = arguments.$index($$i); | 3766 var arg = arguments[$$i]; |
| 3764 if (arg.get$label() != null) { | 3767 if (arg.get$label() != null) { |
| 3765 seenLabel = true; | 3768 seenLabel = true; |
| 3766 } | 3769 } |
| 3767 else if (seenLabel) { | 3770 else if (seenLabel) { |
| 3768 $globals.world.error("bare argument can not follow named arguments", arg.g et$span()); | 3771 $globals.world.error("bare argument can not follow named arguments", arg.g et$span()); |
| 3769 } | 3772 } |
| 3770 args.add$1(this.visitValue(arg.get$value())); | 3773 args.add$1(this.visitValue(arg.get$value())); |
| 3771 } | 3774 } |
| 3772 return new Arguments(arguments, args); | 3775 return new Arguments(arguments, args); |
| 3773 } | 3776 } |
| 3774 MethodGenerator.prototype._invokeNative = function(name, arguments) { | 3777 MethodGenerator.prototype._invokeNative = function(name, arguments) { |
| 3775 var args = Arguments.get$EMPTY(); | 3778 var args = Arguments.get$EMPTY(); |
| 3776 if (arguments.get$length() > (0)) { | 3779 if (arguments.get$length() > (0)) { |
| 3777 args = new Arguments(null, arguments); | 3780 args = new Arguments(null, arguments); |
| 3778 } | 3781 } |
| 3779 var method = $globals.world.corelib.topType.members.$index(name); | 3782 var method = $globals.world.corelib.topType.members.$index(name); |
| 3780 return method.invoke$4(this, method.get$definition(), new Value($globals.world .corelib.topType, null, null), args); | 3783 return method.invoke$4(this, method.get$definition(), new Value($globals.world .corelib.topType, null, null), args); |
| 3781 } | 3784 } |
| 3782 MethodGenerator._escapeString = function(text) { | 3785 MethodGenerator._escapeString = function(text) { |
| 3783 return text.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n", "\\n").replaceAll("\r", "\\r"); | 3786 return text.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n", "\\n").replaceAll("\r", "\\r"); |
| 3784 } | 3787 } |
| 3785 MethodGenerator.prototype.visitStatementsInBlock = function(body) { | 3788 MethodGenerator.prototype.visitStatementsInBlock = function(body) { |
| 3786 if ((body instanceof BlockStatement)) { | 3789 if ((body instanceof BlockStatement)) { |
| 3787 var block = body; | 3790 var block = body; |
| 3788 var $$list = block.body; | 3791 var $$list = block.body; |
| 3789 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3792 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3790 var stmt = $$list.$index($$i); | 3793 var stmt = $$list[$$i]; |
| 3791 stmt.visit$1(this); | 3794 stmt.visit$1(this); |
| 3792 } | 3795 } |
| 3793 } | 3796 } |
| 3794 else { | 3797 else { |
| 3795 if (body != null) body.visit(this); | 3798 if (body != null) body.visit(this); |
| 3796 } | 3799 } |
| 3797 return false; | 3800 return false; |
| 3798 } | 3801 } |
| 3799 MethodGenerator.prototype._pushBlock = function(node, reentrant) { | 3802 MethodGenerator.prototype._pushBlock = function(node, reentrant) { |
| 3800 this._scope = new BlockScope(this, this._scope, node, reentrant); | 3803 this._scope = new BlockScope(this, this._scope, node, reentrant); |
| 3801 } | 3804 } |
| 3802 MethodGenerator.prototype._popBlock = function(node) { | 3805 MethodGenerator.prototype._popBlock = function(node) { |
| 3803 if (this._scope.node != node) { | 3806 if (this._scope.node != node) { |
| 3804 function spanOf(n) { | 3807 function spanOf(n) { |
| 3805 return n != null ? n.get$span() : null; | 3808 return n != null ? n.get$span() : null; |
| 3806 } | 3809 } |
| 3807 $globals.world.internalError(("scope mismatch. Trying to pop \"" + node + "\ " but found ") + (" \"" + this._scope.node + "\""), spanOf(node), spanOf(this._s cope.node)); | 3810 $globals.world.internalError(("scope mismatch. Trying to pop \"" + node + "\ " but found ") + (" \"" + this._scope.node + "\""), spanOf.call$1(node), spanOf. call$1(this._scope.node)); |
| 3808 } | 3811 } |
| 3809 this._scope = this._scope.parent; | 3812 this._scope = this._scope.parent; |
| 3810 } | 3813 } |
| 3811 MethodGenerator.prototype._visitLoop = function(node, visitBody) { | 3814 MethodGenerator.prototype._visitLoop = function(node, visitBody) { |
| 3812 if (this._scope.inferTypes) { | 3815 if (this._scope.inferTypes) { |
| 3813 this._loopFixedPoint(node, visitBody); | 3816 this._loopFixedPoint(node, visitBody); |
| 3814 } | 3817 } |
| 3815 else { | 3818 else { |
| 3816 this._pushBlock(node, true); | 3819 this._pushBlock(node, true); |
| 3817 visitBody(); | 3820 visitBody.call$0(); |
| 3818 this._popBlock(node); | 3821 this._popBlock(node); |
| 3819 } | 3822 } |
| 3820 } | 3823 } |
| 3821 MethodGenerator.prototype._loopFixedPoint = function(node, visitBody) { | 3824 MethodGenerator.prototype._loopFixedPoint = function(node, visitBody) { |
| 3822 var savedCounters = this.counters; | 3825 var savedCounters = this.counters; |
| 3823 var savedWriter = this.writer; | 3826 var savedWriter = this.writer; |
| 3824 var tries = (0); | 3827 var tries = (0); |
| 3825 var startScope = this._scope.snapshot(); | 3828 var startScope = this._scope.snapshot(); |
| 3826 var s = startScope; | 3829 var s = startScope; |
| 3827 while (true) { | 3830 while (true) { |
| 3828 this.writer = new CodeWriter(); | 3831 this.writer = new CodeWriter(); |
| 3829 this.counters = new CounterLog(); | 3832 this.counters = new CounterLog(); |
| 3830 this._pushBlock(node, true); | 3833 this._pushBlock(node, true); |
| 3831 if (tries++ >= $globals.options.maxInferenceIterations) { | 3834 if (tries++ >= $globals.options.maxInferenceIterations) { |
| 3832 this._scope.inferTypes = false; | 3835 this._scope.inferTypes = false; |
| 3833 } | 3836 } |
| 3834 visitBody(); | 3837 visitBody.call$0(); |
| 3835 this._popBlock(node); | 3838 this._popBlock(node); |
| 3836 if (!this._scope.inferTypes || !this._scope.unionWith(s)) { | 3839 if (!this._scope.inferTypes || !this._scope.unionWith(s)) { |
| 3837 break; | 3840 break; |
| 3838 } | 3841 } |
| 3839 s = this._scope.snapshot(); | 3842 s = this._scope.snapshot(); |
| 3840 } | 3843 } |
| 3841 savedWriter.write$1(this.writer.get$text()); | 3844 savedWriter.write$1(this.writer.get$text()); |
| 3842 this.writer = savedWriter; | 3845 this.writer = savedWriter; |
| 3843 savedCounters.add$1(this.counters); | 3846 savedCounters.add$1(this.counters); |
| 3844 this.counters = savedCounters; | 3847 this.counters = savedCounters; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3876 } | 3879 } |
| 3877 return this.visitValue(node); | 3880 return this.visitValue(node); |
| 3878 } | 3881 } |
| 3879 MethodGenerator.prototype.visitDietStatement = function(node) { | 3882 MethodGenerator.prototype.visitDietStatement = function(node) { |
| 3880 var parser = new Parser(node.span.file, false, false, false, node.span.start); | 3883 var parser = new Parser(node.span.file, false, false, false, node.span.start); |
| 3881 this.visitStatementsInBlock(parser.block$0()); | 3884 this.visitStatementsInBlock(parser.block$0()); |
| 3882 return false; | 3885 return false; |
| 3883 } | 3886 } |
| 3884 MethodGenerator.prototype.visitVariableDefinition = function(node) { | 3887 MethodGenerator.prototype.visitVariableDefinition = function(node) { |
| 3885 var isFinal = false; | 3888 var isFinal = false; |
| 3886 if (node.modifiers != null && $eq(node.modifiers.$index((0)).get$kind(), (99)) ) { | 3889 if (node.modifiers != null && $eq(node.modifiers[(0)].get$kind(), (99))) { |
| 3887 isFinal = true; | 3890 isFinal = true; |
| 3888 } | 3891 } |
| 3889 this.writer.write("var "); | 3892 this.writer.write("var "); |
| 3890 var type = this.method.resolveType$2(node.type, false); | 3893 var type = this.method.resolveType$2(node.type, false); |
| 3891 for (var i = (0); | 3894 for (var i = (0); |
| 3892 i < node.names.get$length(); i++) { | 3895 i < node.names.get$length(); i++) { |
| 3893 if (i > (0)) { | 3896 if (i > (0)) { |
| 3894 this.writer.write(", "); | 3897 this.writer.write(", "); |
| 3895 } | 3898 } |
| 3896 var name = node.names.$index(i).get$name(); | 3899 var name = node.names[i].get$name(); |
| 3897 var value = this.visitValue(node.values.$index(i)); | 3900 var value = this.visitValue(node.values[i]); |
| 3898 if (isFinal && value == null) { | 3901 if (isFinal && value == null) { |
| 3899 $globals.world.error("no value specified for final variable", node.span); | 3902 $globals.world.error("no value specified for final variable", node.span); |
| 3900 } | 3903 } |
| 3901 var val = this._scope.create(name, type, node.names.$index(i).get$span(), is Final, false); | 3904 var val = this._scope.create(name, type, node.names[i].get$span(), isFinal, false); |
| 3902 if (value == null) { | 3905 if (value == null) { |
| 3903 if (this._scope.reentrant) { | 3906 if (this._scope.reentrant) { |
| 3904 this.writer.write(("" + val.get$code() + " = null")); | 3907 this.writer.write(("" + val.get$code() + " = null")); |
| 3905 } | 3908 } |
| 3906 else { | 3909 else { |
| 3907 this.writer.write(("" + val.get$code())); | 3910 this.writer.write(("" + val.get$code())); |
| 3908 } | 3911 } |
| 3909 } | 3912 } |
| 3910 else { | 3913 else { |
| 3911 value = value.convertTo$2(this, type); | 3914 value = value.convertTo$2(this, type); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4033 if (node.test != null) { | 4036 if (node.test != null) { |
| 4034 var test = $this.visitBool(node.test); | 4037 var test = $this.visitBool(node.test); |
| 4035 $this.writer.write((" " + test.get$code() + "; ")); | 4038 $this.writer.write((" " + test.get$code() + "; ")); |
| 4036 } | 4039 } |
| 4037 else { | 4040 else { |
| 4038 $this.writer.write("; "); | 4041 $this.writer.write("; "); |
| 4039 } | 4042 } |
| 4040 var needsComma = false; | 4043 var needsComma = false; |
| 4041 var $$list = node.step; | 4044 var $$list = node.step; |
| 4042 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4045 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4043 var s = $$list.$index($$i); | 4046 var s = $$list[$$i]; |
| 4044 if (needsComma) $this.writer.write(", "); | 4047 if (needsComma) $this.writer.write(", "); |
| 4045 var sv = $this.visitVoid(s); | 4048 var sv = $this.visitVoid(s); |
| 4046 $this.writer.write(sv.get$code()); | 4049 $this.writer.write(sv.get$code()); |
| 4047 needsComma = true; | 4050 needsComma = true; |
| 4048 } | 4051 } |
| 4049 $this.writer.write(") "); | 4052 $this.writer.write(") "); |
| 4050 $this._pushBlock(node.body, false); | 4053 $this._pushBlock(node.body, false); |
| 4051 node.body.visit($this); | 4054 node.body.visit($this); |
| 4052 $this._popBlock(node.body); | 4055 $this._popBlock(node.body); |
| 4053 }) | 4056 }) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4105 MethodGenerator.prototype._genStackTraceOf = function(trace, ex) { | 4108 MethodGenerator.prototype._genStackTraceOf = function(trace, ex) { |
| 4106 var result = this._invokeNative("_stackTraceOf", [ex]); | 4109 var result = this._invokeNative("_stackTraceOf", [ex]); |
| 4107 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + " ;")); | 4110 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + " ;")); |
| 4108 } | 4111 } |
| 4109 MethodGenerator.prototype.visitTryStatement = function(node) { | 4112 MethodGenerator.prototype.visitTryStatement = function(node) { |
| 4110 this.writer.enterBlock("try {"); | 4113 this.writer.enterBlock("try {"); |
| 4111 this._pushBlock(node.body, false); | 4114 this._pushBlock(node.body, false); |
| 4112 this.visitStatementsInBlock(node.body); | 4115 this.visitStatementsInBlock(node.body); |
| 4113 this._popBlock(node.body); | 4116 this._popBlock(node.body); |
| 4114 if (node.catches.get$length() == (1)) { | 4117 if (node.catches.get$length() == (1)) { |
| 4115 var catch_ = node.catches.$index((0)); | 4118 var catch_ = node.catches[(0)]; |
| 4116 this._pushBlock(catch_, false); | 4119 this._pushBlock(catch_, false); |
| 4117 var exType = this.method.resolveType$2(catch_.get$exception().get$type(), fa lse); | 4120 var exType = this.method.resolveType$2(catch_.get$exception().get$type(), fa lse); |
| 4118 var ex = this._scope.declare(catch_.get$exception()); | 4121 var ex = this._scope.declare(catch_.get$exception()); |
| 4119 this._scope.rethrow = ex.get$code(); | 4122 this._scope.rethrow = ex.get$code(); |
| 4120 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); | 4123 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); |
| 4121 if (catch_.get$trace() != null) { | 4124 if (catch_.get$trace() != null) { |
| 4122 var trace = this._scope.declare(catch_.get$trace()); | 4125 var trace = this._scope.declare(catch_.get$trace()); |
| 4123 this._genStackTraceOf(trace, ex); | 4126 this._genStackTraceOf(trace, ex); |
| 4124 } | 4127 } |
| 4125 this._genToDartException(ex); | 4128 this._genToDartException(ex); |
| 4126 if (!exType.get$isVarOrObject()) { | 4129 if (!exType.get$isVarOrObject()) { |
| 4127 var test = ex.instanceOf$3$isTrue$forceCheck(this, exType, catch_.get$exce ption().get$span(), false, true); | 4130 var test = ex.instanceOf$3$isTrue$forceCheck(this, exType, catch_.get$exce ption().get$span(), false, true); |
| 4128 this.writer.writeln(("if (" + test.get$code() + ") throw " + ex.get$code() + ";")); | 4131 this.writer.writeln(("if (" + test.get$code() + ") throw " + ex.get$code() + ";")); |
| 4129 } | 4132 } |
| 4130 this.visitStatementsInBlock(node.catches.$index((0)).get$body()); | 4133 this.visitStatementsInBlock(node.catches[(0)].get$body()); |
| 4131 this._popBlock(catch_); | 4134 this._popBlock(catch_); |
| 4132 } | 4135 } |
| 4133 else if (node.catches.get$length() > (0)) { | 4136 else if (node.catches.get$length() > (0)) { |
| 4134 this._pushBlock(node, false); | 4137 this._pushBlock(node, false); |
| 4135 var ex = this._scope.create("$ex", $globals.world.varType, null, false, fals e); | 4138 var ex = this._scope.create("$ex", $globals.world.varType, null, false, fals e); |
| 4136 this._scope.rethrow = ex.get$code(); | 4139 this._scope.rethrow = ex.get$code(); |
| 4137 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); | 4140 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); |
| 4138 var trace = null; | 4141 var trace = null; |
| 4139 if (node.catches.some((function (c) { | 4142 if (node.catches.some((function (c) { |
| 4140 return c.get$trace() != null; | 4143 return c.get$trace() != null; |
| 4141 }) | 4144 }) |
| 4142 )) { | 4145 )) { |
| 4143 trace = this._scope.create("$trace", $globals.world.varType, null, false, false); | 4146 trace = this._scope.create("$trace", $globals.world.varType, null, false, false); |
| 4144 this._genStackTraceOf(trace, ex); | 4147 this._genStackTraceOf(trace, ex); |
| 4145 } | 4148 } |
| 4146 this._genToDartException(ex); | 4149 this._genToDartException(ex); |
| 4147 var needsRethrow = true; | 4150 var needsRethrow = true; |
| 4148 for (var i = (0); | 4151 for (var i = (0); |
| 4149 i < node.catches.get$length(); i++) { | 4152 i < node.catches.get$length(); i++) { |
| 4150 var catch_ = node.catches.$index(i); | 4153 var catch_ = node.catches[i]; |
| 4151 this._pushBlock(catch_, false); | 4154 this._pushBlock(catch_, false); |
| 4152 var tmpType = this.method.resolveType$2(catch_.get$exception().get$type(), false); | 4155 var tmpType = this.method.resolveType$2(catch_.get$exception().get$type(), false); |
| 4153 var tmp = this._scope.declare(catch_.get$exception()); | 4156 var tmp = this._scope.declare(catch_.get$exception()); |
| 4154 if (!tmpType.get$isVarOrObject()) { | 4157 if (!tmpType.get$isVarOrObject()) { |
| 4155 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e xception().get$span(), true, true); | 4158 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e xception().get$span(), true, true); |
| 4156 if (i == (0)) { | 4159 if (i == (0)) { |
| 4157 this.writer.enterBlock(("if (" + test.get$code() + ") {")); | 4160 this.writer.enterBlock(("if (" + test.get$code() + ") {")); |
| 4158 } | 4161 } |
| 4159 else { | 4162 else { |
| 4160 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); | 4163 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); |
| 4161 } | 4164 } |
| 4162 } | 4165 } |
| 4163 else if (i > (0)) { | 4166 else if (i > (0)) { |
| 4164 this.writer.nextBlock("} else {"); | 4167 this.writer.nextBlock("} else {"); |
| 4165 } | 4168 } |
| 4166 this.writer.writeln(("var " + tmp.get$code() + " = " + ex.get$code() + ";" )); | 4169 this.writer.writeln(("var " + tmp.get$code() + " = " + ex.get$code() + ";" )); |
| 4167 if (catch_.get$trace() != null) { | 4170 if (catch_.get$trace() != null) { |
| 4168 var tmptrace = this._scope.declare(catch_.get$trace()); | 4171 var tmptrace = this._scope.declare(catch_.get$trace()); |
| 4169 this.writer.writeln(("var " + tmptrace.get$code() + " = " + trace.get$co de() + ";")); | 4172 this.writer.writeln(("var " + tmptrace.get$code() + " = " + trace.get$co de() + ";")); |
| 4170 } | 4173 } |
| 4171 this.visitStatementsInBlock(catch_.get$body()); | 4174 this.visitStatementsInBlock(catch_.get$body()); |
| 4172 this._popBlock(catch_); | 4175 this._popBlock(catch_); |
| 4173 if (tmpType.get$isVarOrObject()) { | 4176 if (tmpType.get$isVarOrObject()) { |
| 4174 if (i + (1) < node.catches.get$length()) { | 4177 if (i + (1) < node.catches.get$length()) { |
| 4175 $globals.world.error("Unreachable catch clause", node.catches.$index(i + (1)).get$span()); | 4178 $globals.world.error("Unreachable catch clause", node.catches[i + (1)] .get$span()); |
| 4176 } | 4179 } |
| 4177 if (i > (0)) { | 4180 if (i > (0)) { |
| 4178 this.writer.exitBlock("}"); | 4181 this.writer.exitBlock("}"); |
| 4179 } | 4182 } |
| 4180 needsRethrow = false; | 4183 needsRethrow = false; |
| 4181 break; | 4184 break; |
| 4182 } | 4185 } |
| 4183 } | 4186 } |
| 4184 if (needsRethrow) { | 4187 if (needsRethrow) { |
| 4185 this.writer.nextBlock("} else {"); | 4188 this.writer.nextBlock("} else {"); |
| 4186 this.writer.writeln(("throw " + ex.get$code() + ";")); | 4189 this.writer.writeln(("throw " + ex.get$code() + ";")); |
| 4187 this.writer.exitBlock("}"); | 4190 this.writer.exitBlock("}"); |
| 4188 } | 4191 } |
| 4189 this._popBlock(node); | 4192 this._popBlock(node); |
| 4190 } | 4193 } |
| 4191 if (node.finallyBlock != null) { | 4194 if (node.finallyBlock != null) { |
| 4192 this.writer.nextBlock("} finally {"); | 4195 this.writer.nextBlock("} finally {"); |
| 4193 this._pushBlock(node.finallyBlock, false); | 4196 this._pushBlock(node.finallyBlock, false); |
| 4194 this.visitStatementsInBlock(node.finallyBlock); | 4197 this.visitStatementsInBlock(node.finallyBlock); |
| 4195 this._popBlock(node.finallyBlock); | 4198 this._popBlock(node.finallyBlock); |
| 4196 } | 4199 } |
| 4197 this.writer.exitBlock("}"); | 4200 this.writer.exitBlock("}"); |
| 4198 return false; | 4201 return false; |
| 4199 } | 4202 } |
| 4200 MethodGenerator.prototype.visitSwitchStatement = function(node) { | 4203 MethodGenerator.prototype.visitSwitchStatement = function(node) { |
| 4201 var test = this.visitValue(node.test); | 4204 var test = this.visitValue(node.test); |
| 4202 this.writer.enterBlock(("switch (" + test.get$code() + ") {")); | 4205 this.writer.enterBlock(("switch (" + test.get$code() + ") {")); |
| 4203 var $$list = node.cases; | 4206 var $$list = node.cases; |
| 4204 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4207 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4205 var case_ = $$list.$index($$i); | 4208 var case_ = $$list[$$i]; |
| 4206 if (case_.get$label() != null) { | 4209 if (case_.get$label() != null) { |
| 4207 $globals.world.error("unimplemented: labeled case statement", case_.get$sp an()); | 4210 $globals.world.error("unimplemented: labeled case statement", case_.get$sp an()); |
| 4208 } | 4211 } |
| 4209 this._pushBlock(case_, false); | 4212 this._pushBlock(case_, false); |
| 4210 for (var i = (0); | 4213 for (var i = (0); |
| 4211 i < case_.get$cases().get$length(); i++) { | 4214 i < case_.get$cases().get$length(); i++) { |
| 4212 var expr = case_.get$cases().$index(i); | 4215 var expr = case_.get$cases().$index(i); |
| 4213 if (expr == null) { | 4216 if (expr == null) { |
| 4214 if (i < case_.get$cases().get$length() - (1)) { | 4217 if (i < case_.get$cases().get$length() - (1)) { |
| 4215 $globals.world.error("default clause must be the last case", case_.get $span()); | 4218 $globals.world.error("default clause must be the last case", case_.get $span()); |
| 4216 } | 4219 } |
| 4217 this.writer.writeln("default:"); | 4220 this.writer.writeln("default:"); |
| 4218 } | 4221 } |
| 4219 else { | 4222 else { |
| 4220 var value = this.visitValue(expr); | 4223 var value = this.visitValue(expr); |
| 4221 this.writer.writeln(("case " + value.get$code() + ":")); | 4224 this.writer.writeln(("case " + value.get$code() + ":")); |
| 4222 } | 4225 } |
| 4223 } | 4226 } |
| 4224 this.writer.enterBlock(""); | 4227 this.writer.enterBlock(""); |
| 4225 var caseExits = this._visitAllStatements(case_.get$statements(), false); | 4228 var caseExits = this._visitAllStatements(case_.get$statements(), false); |
| 4226 if ($ne(case_, node.cases.$index(node.cases.get$length() - (1))) && !caseExi ts) { | 4229 if ($ne(case_, node.cases[node.cases.get$length() - (1)]) && !caseExits) { |
| 4227 var span = case_.get$statements().$index(case_.get$statements().get$length () - (1)).get$span(); | 4230 var span = case_.get$statements().$index(case_.get$statements().get$length () - (1)).get$span(); |
| 4228 this.writer.writeln("$throw(new FallThroughError());"); | 4231 this.writer.writeln("$throw(new FallThroughError());"); |
| 4229 $globals.world.gen.corejs.useThrow = true; | 4232 $globals.world.gen.corejs.useThrow = true; |
| 4230 } | 4233 } |
| 4231 this.writer.exitBlock(""); | 4234 this.writer.exitBlock(""); |
| 4232 this._popBlock(case_); | 4235 this._popBlock(case_); |
| 4233 } | 4236 } |
| 4234 this.writer.exitBlock("}"); | 4237 this.writer.exitBlock("}"); |
| 4235 return false; | 4238 return false; |
| 4236 } | 4239 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4369 var y = this.visitValue(node.y); | 4372 var y = this.visitValue(node.y); |
| 4370 return x.binop$4(kind, y, this, node); | 4373 return x.binop$4(kind, y, this, node); |
| 4371 } | 4374 } |
| 4372 var assignKind = TokenKind.kindFromAssign(node.op.kind); | 4375 var assignKind = TokenKind.kindFromAssign(node.op.kind); |
| 4373 if ($eq(assignKind, (-1))) { | 4376 if ($eq(assignKind, (-1))) { |
| 4374 var x = this.visitValue(node.x); | 4377 var x = this.visitValue(node.x); |
| 4375 var y = this.visitValue(node.y); | 4378 var y = this.visitValue(node.y); |
| 4376 return x.binop$4(kind, y, this, node); | 4379 return x.binop$4(kind, y, this, node); |
| 4377 } | 4380 } |
| 4378 else if (($ne(assignKind, (0))) && this._expressionNeedsParens(node.y)) { | 4381 else if (($ne(assignKind, (0))) && this._expressionNeedsParens(node.y)) { |
| 4379 return this._visitAssign(assignKind, node.x, new ParenExpression(node.y, nod e.y.span), node, to$call$1(null), isVoid); | 4382 return this._visitAssign(assignKind, node.x, new ParenExpression(node.y, nod e.y.span), node, isVoid ? (1) : (2)); |
| 4380 } | 4383 } |
| 4381 else { | 4384 else { |
| 4382 return this._visitAssign(assignKind, node.x, node.y, node, to$call$1(null), isVoid); | 4385 return this._visitAssign(assignKind, node.x, node.y, node, isVoid ? (1) : (2 )); |
| 4383 } | 4386 } |
| 4384 } | 4387 } |
| 4385 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captur eOriginal, isVoid) { | 4388 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, return Kind) { |
| 4386 if (captureOriginal == null) { | |
| 4387 captureOriginal = (function (x) { | |
| 4388 return x; | |
| 4389 }) | |
| 4390 ; | |
| 4391 } | |
| 4392 if ((xn instanceof VarExpression)) { | 4389 if ((xn instanceof VarExpression)) { |
| 4393 return this._visitVarAssign(kind, xn, yn, position, captureOriginal); | 4390 return this._visitVarAssign(kind, xn, yn, position, returnKind); |
| 4394 } | 4391 } |
| 4395 else if ((xn instanceof IndexExpression)) { | 4392 else if ((xn instanceof IndexExpression)) { |
| 4396 return this._visitIndexAssign(kind, xn, yn, position, captureOriginal, isVoi d); | 4393 return this._visitIndexAssign(kind, xn, yn, position, returnKind); |
| 4397 } | 4394 } |
| 4398 else if ((xn instanceof DotExpression)) { | 4395 else if ((xn instanceof DotExpression)) { |
| 4399 return this._visitDotAssign(kind, xn, yn, position, captureOriginal); | 4396 return this._visitDotAssign(kind, xn, yn, position, returnKind); |
| 4400 } | 4397 } |
| 4401 else { | 4398 else { |
| 4402 $globals.world.error("illegal lhs", xn.span); | 4399 $globals.world.error("illegal lhs", xn.span); |
| 4403 } | 4400 } |
| 4404 } | 4401 } |
| 4405 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap tureOriginal) { | 4402 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, ret urnKind) { |
| 4406 var name = xn.name.name; | 4403 var name = xn.name.name; |
| 4407 var x = this._scope.lookup(name); | 4404 var x = this._scope.lookup(name); |
| 4408 var y = this.visitValue(yn); | 4405 var y = this.visitValue(yn); |
| 4409 if (x != null) { | 4406 if (x != null) { |
| 4410 y = y.convertTo$2(this, x.get$staticType()); | 4407 y = y.convertTo$2(this, x.get$staticType()); |
| 4411 this._scope.inferAssign(name, Value.union(x, y)); | 4408 this._scope.inferAssign(name, Value.union(x, y)); |
| 4409 if (x.get$isFinal()) { | |
| 4410 $globals.world.error(("final variable \"" + x.get$code() + "\" is not assi gnable"), position.span); | |
| 4411 } | |
| 4412 if (kind == (0)) { | |
| 4413 return new Value(y.get$type(), ("" + x.get$code() + " = " + y.get$code()), position.span); | |
| 4414 } | |
| 4415 else if (x.get$type().get$isNum() && y.get$type().get$isNum() && (kind != (4 6))) { | |
| 4416 if (returnKind == (3)) { | |
| 4417 $globals.world.internalError("should not be here", position.span); | |
| 4418 } | |
| 4419 var op = TokenKind.kindToString(kind); | |
| 4420 return new Value(y.get$type(), ("" + x.get$code() + " " + op + "= " + y.ge t$code()), position.span); | |
| 4421 } | |
| 4422 else { | |
| 4423 var right = x; | |
| 4424 y = right.binop$4(kind, y, this, position); | |
| 4425 if (returnKind == (3)) { | |
| 4426 var tmp = this.forceTemp(x); | |
| 4427 var ret = new Value(x.get$type(), ("(" + tmp.get$code() + " = " + x.get$ code() + ", " + x.get$code() + " = " + y.get$code() + ", " + tmp.get$code() + ") "), position.span); | |
| 4428 this.freeTemp(tmp); | |
| 4429 return ret; | |
| 4430 } | |
| 4431 else { | |
| 4432 return new Value(x.get$type(), ("" + x.get$code() + " = " + y.get$code() ), position.span); | |
| 4433 } | |
| 4434 } | |
| 4412 } | 4435 } |
| 4413 else { | 4436 else { |
| 4414 var members = this.method.declaringType.resolveMember(name); | |
| 4415 x = this._makeThisOrType(position.span); | 4437 x = this._makeThisOrType(position.span); |
| 4416 if (members != null) { | 4438 return x.set_$4$kind$returnKind(this, name, position, y, kind, returnKind); |
| 4417 if ($globals.options.forceDynamic && !members.get$isStatic()) { | |
| 4418 members = this.findMembers(xn.name.name); | |
| 4419 } | |
| 4420 if (kind == (0)) { | |
| 4421 return x.set_$4(this, name, position, y); | |
| 4422 } | |
| 4423 else if (!members.get$treatAsField() || members.get$containsMethods()) { | |
| 4424 var right = x.get_$3(this, name, position); | |
| 4425 right = captureOriginal(right); | |
| 4426 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arguments(null, [y])); | |
| 4427 return x.set_$4(this, name, position, y); | |
| 4428 } | |
| 4429 else { | |
| 4430 x = x.get_$3(this, name, position); | |
| 4431 } | |
| 4432 } | |
| 4433 else { | |
| 4434 var member = this.get$library().lookup(name, xn.name.span); | |
| 4435 if (member == null) { | |
| 4436 $globals.world.warning(("can not resolve " + name), xn.span); | |
| 4437 return this._makeMissingValue(name); | |
| 4438 } | |
| 4439 members = new MemberSet(member, false); | |
| 4440 if (!members.get$treatAsField() || members.get$containsMethods()) { | |
| 4441 if (kind != (0)) { | |
| 4442 var right = members._get$3(this, position, x); | |
| 4443 right = captureOriginal(right); | |
| 4444 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n ew Arguments(null, [y])); | |
| 4445 } | |
| 4446 return members._set$4(this, position, x, y); | |
| 4447 } | |
| 4448 else { | |
| 4449 x = members._get$3(this, position, x); | |
| 4450 } | |
| 4451 } | |
| 4452 y = y.convertTo$2(this, x.get$staticType()); | |
| 4453 } | |
| 4454 if (x.get$isFinal()) { | |
| 4455 $globals.world.error(("final variable \"" + x.get$code() + "\" is not assign able"), position.span); | |
| 4456 } | |
| 4457 if (kind == (0)) { | |
| 4458 x = captureOriginal(x); | |
| 4459 return new Value(y.get$type(), ("" + x.get$code() + " = " + y.get$code()), p osition.span); | |
| 4460 } | |
| 4461 else if (x.get$type().get$isNum() && y.get$type().get$isNum() && (kind != (46) )) { | |
| 4462 x = captureOriginal(x); | |
| 4463 var op = TokenKind.kindToString(kind); | |
| 4464 return new Value(y.get$type(), ("" + x.get$code() + " " + op + "= " + y.get$ code()), position.span); | |
| 4465 } | |
| 4466 else { | |
| 4467 var right = x; | |
| 4468 right = captureOriginal(right); | |
| 4469 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y])); | |
| 4470 return new Value(y.get$type(), ("" + x.get$code() + " = " + y.get$code()), p osition.span); | |
| 4471 } | 4439 } |
| 4472 } | 4440 } |
| 4473 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, c aptureOriginal, isVoid) { | 4441 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, r eturnKind) { |
| 4474 var target = this.visitValue(xn.target); | 4442 var target = this.visitValue(xn.target); |
| 4475 var tmptarget = target; | |
| 4476 if (kind != (0)) tmptarget = this.getTemp(target); | |
| 4477 var index = this.visitValue(xn.index); | 4443 var index = this.visitValue(xn.index); |
| 4478 var tmpindex = index; | |
| 4479 if (kind != (0)) tmpindex = this.getTemp(index); | |
| 4480 var y = this.visitValue(yn); | 4444 var y = this.visitValue(yn); |
| 4481 if (kind != (0)) { | 4445 return target.setIndex$4$kind$returnKind(this, index, position, y, kind, retur nKind); |
| 4482 index = this.assignTemp(tmpindex, index); | |
| 4483 var right = tmptarget.invoke$4(this, ":index", position, new Arguments(null, [tmpindex])); | |
| 4484 right = captureOriginal(right); | |
| 4485 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y])); | |
| 4486 } | |
| 4487 var tmpy = null; | |
| 4488 if (!isVoid) { | |
| 4489 tmpy = this.getTemp(y); | |
| 4490 y = this.assignTemp(tmpy, y); | |
| 4491 } | |
| 4492 var ret = this.assignTemp(tmptarget, target).invoke(this, ":setindex", positio n, new Arguments(null, [index, y]), false); | |
| 4493 if (tmpy != null) { | |
| 4494 ret = new Value(ret.get$type(), ("(" + ret.get$code() + ", " + tmpy.get$code () + ")"), ret.get$span()); | |
| 4495 if ($ne(tmpy, y)) this.freeTemp(tmpy); | |
| 4496 } | |
| 4497 if ($ne(tmptarget, target)) this.freeTemp(tmptarget); | |
| 4498 if ($ne(tmpindex, index)) this.freeTemp(tmpindex); | |
| 4499 return ret; | |
| 4500 } | 4446 } |
| 4501 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, cap tureOriginal) { | 4447 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, ret urnKind) { |
| 4502 var target = xn.self.visit(this); | 4448 var target = xn.self.visit(this); |
| 4503 var y = this.visitValue(yn); | 4449 var y = this.visitValue(yn); |
| 4504 var tmptarget = target; | 4450 return target.set_$4$kind$returnKind(this, xn.name.name, xn.name, y, kind, ret urnKind); |
| 4505 if (kind != (0)) { | |
| 4506 tmptarget = this.getTemp(target); | |
| 4507 var right = tmptarget.get_$3(this, xn.name.name, xn.name); | |
| 4508 right = captureOriginal(right); | |
| 4509 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg uments(null, [y])); | |
| 4510 } | |
| 4511 var ret = this.assignTemp(tmptarget, target).set_(this, xn.name.name, xn.name, y, false); | |
| 4512 if ($ne(tmptarget, target)) this.freeTemp(tmptarget); | |
| 4513 return ret; | |
| 4514 } | 4451 } |
| 4515 MethodGenerator.prototype.visitUnaryExpression = function(node) { | 4452 MethodGenerator.prototype.visitUnaryExpression = function(node) { |
| 4516 var value = this.visitValue(node.self); | 4453 var value = this.visitValue(node.self); |
| 4517 switch (node.op.kind) { | 4454 switch (node.op.kind) { |
| 4518 case (16): | 4455 case (16): |
| 4519 case (17): | 4456 case (17): |
| 4520 | 4457 |
| 4521 if (value.get$type().get$isNum()) { | 4458 if (value.get$type().get$isNum()) { |
| 4522 return new Value(value.get$type(), ("" + node.op + value.get$code()), no de.span); | 4459 return new Value(value.get$type(), ("" + node.op + value.get$code()), no de.span); |
| 4523 } | 4460 } |
| 4524 else { | 4461 else { |
| 4525 var kind = ((16) == node.op.kind ? (42) : (43)); | 4462 var kind = ((16) == node.op.kind ? (42) : (43)); |
| 4526 var operand = new LiteralExpression(Value.fromInt((1), node.span), node. span); | 4463 var operand = new LiteralExpression(Value.fromInt((1), node.span), node. span); |
| 4527 var assignValue = this._visitAssign(kind, node.self, operand, node, to$c all$1(null), false); | 4464 var assignValue = this._visitAssign(kind, node.self, operand, node, (2)) ; |
| 4528 return new Value(assignValue.get$type(), ("(" + assignValue.get$code() + ")"), node.span); | 4465 return new Value(assignValue.get$type(), ("(" + assignValue.get$code() + ")"), node.span); |
| 4529 } | 4466 } |
| 4530 | 4467 |
| 4531 } | 4468 } |
| 4532 return value.unop$3(node.op.kind, this, node); | 4469 return value.unop$3(node.op.kind, this, node); |
| 4533 } | 4470 } |
| 4534 MethodGenerator.prototype.visitDeclaredIdentifier = function(node) { | 4471 MethodGenerator.prototype.visitDeclaredIdentifier = function(node) { |
| 4535 $globals.world.error("Expected expression", node.span); | 4472 $globals.world.error("Expected expression", node.span); |
| 4536 } | 4473 } |
| 4537 MethodGenerator.prototype.visitAwaitExpression = function(node) { | 4474 MethodGenerator.prototype.visitAwaitExpression = function(node) { |
| 4538 $globals.world.internalError("Await expressions should have been eliminated be fore code generation", node.span); | 4475 $globals.world.internalError("Await expressions should have been eliminated be fore code generation", node.span); |
| 4539 } | 4476 } |
| 4540 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { | 4477 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { |
| 4541 var $this = this; // closure support | |
| 4542 var value = this.visitValue(node.body); | 4478 var value = this.visitValue(node.body); |
| 4543 if (value.get$type().get$isNum() && !value.get$isFinal()) { | 4479 if (value.get$type().get$isNum() && !value.get$isFinal()) { |
| 4544 return new Value(value.get$type(), ("" + value.get$code() + node.op), node.s pan); | 4480 return new Value(value.get$type(), ("" + value.get$code() + node.op), node.s pan); |
| 4545 } | 4481 } |
| 4546 var kind = ((16) == node.op.kind) ? (42) : (43); | 4482 var kind = ((16) == node.op.kind) ? (42) : (43); |
| 4547 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.span); | 4483 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.span); |
| 4548 var tmpleft = null, left = null; | 4484 var ret = this._visitAssign(kind, node.body, operand, node, isVoid ? (1) : (3) ); |
| 4549 var ret = this._visitAssign(kind, node.body, operand, node, (function (l) { | |
| 4550 if (isVoid) { | |
| 4551 return l; | |
| 4552 } | |
| 4553 else { | |
| 4554 left = l; | |
| 4555 tmpleft = $this.forceTemp(l); | |
| 4556 return $this.assignTemp(tmpleft, left); | |
| 4557 } | |
| 4558 }) | |
| 4559 , false); | |
| 4560 if (tmpleft != null) { | |
| 4561 ret = new Value(ret.get$type(), ("(" + ret.get$code() + ", " + tmpleft.get$c ode() + ")"), node.span); | |
| 4562 } | |
| 4563 if ($ne(tmpleft, left)) { | |
| 4564 this.freeTemp(tmpleft); | |
| 4565 } | |
| 4566 return ret; | 4485 return ret; |
| 4567 } | 4486 } |
| 4568 MethodGenerator.prototype.visitNewExpression = function(node) { | 4487 MethodGenerator.prototype.visitNewExpression = function(node) { |
| 4569 var typeRef = node.type; | 4488 var typeRef = node.type; |
| 4570 var constructorName = ""; | 4489 var constructorName = ""; |
| 4571 if (node.name != null) { | 4490 if (node.name != null) { |
| 4572 constructorName = node.name.name; | 4491 constructorName = node.name.name; |
| 4573 } | 4492 } |
| 4574 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) && typeRef.get$names() != null) { | 4493 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) && typeRef.get$names() != null) { |
| 4575 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); | 4494 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 4594 } | 4513 } |
| 4595 $globals.world.error(("no matching constructor for " + name), node.span); | 4514 $globals.world.error(("no matching constructor for " + name), node.span); |
| 4596 return this._makeMissingValue(name); | 4515 return this._makeMissingValue(name); |
| 4597 } | 4516 } |
| 4598 if (node.isConst) { | 4517 if (node.isConst) { |
| 4599 if (!m.get$isConst()) { | 4518 if (!m.get$isConst()) { |
| 4600 $globals.world.error("can't use const on a non-const constructor", node.sp an); | 4519 $globals.world.error("can't use const on a non-const constructor", node.sp an); |
| 4601 } | 4520 } |
| 4602 var $$list = node.arguments; | 4521 var $$list = node.arguments; |
| 4603 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4522 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4604 var arg = $$list.$index($$i); | 4523 var arg = $$list[$$i]; |
| 4605 if (!this.visitValue(arg.get$value()).get$isConst()) { | 4524 if (!this.visitValue(arg.get$value()).get$isConst()) { |
| 4606 $globals.world.error("const constructor expects const arguments", arg.ge t$span()); | 4525 $globals.world.error("const constructor expects const arguments", arg.ge t$span()); |
| 4607 } | 4526 } |
| 4608 } | 4527 } |
| 4609 } | 4528 } |
| 4610 var target = new TypeValue(type, typeRef.get$span()); | 4529 var target = new TypeValue(type, typeRef.get$span()); |
| 4611 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); | 4530 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); |
| 4612 } | 4531 } |
| 4613 MethodGenerator.prototype.visitListExpression = function(node) { | 4532 MethodGenerator.prototype.visitListExpression = function(node) { |
| 4614 var argValues = []; | 4533 var argValues = []; |
| 4615 var listType = $globals.world.listType; | 4534 var listType = $globals.world.listType; |
| 4616 var type = $globals.world.varType; | 4535 var type = $globals.world.varType; |
| 4617 if (node.itemType != null) { | 4536 if (node.itemType != null) { |
| 4618 type = this.method.resolveType$2(node.itemType, true); | 4537 type = this.method.resolveType$2(node.itemType, true); |
| 4619 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara ms())) { | 4538 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara ms())) { |
| 4620 $globals.world.error("type parameter cannot be used in const list literals "); | 4539 $globals.world.error("type parameter cannot be used in const list literals "); |
| 4621 } | 4540 } |
| 4622 listType = listType.getOrMakeConcreteType$1([type]); | 4541 listType = listType.getOrMakeConcreteType$1([type]); |
| 4623 } | 4542 } |
| 4624 var $$list = node.values; | 4543 var $$list = node.values; |
| 4625 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4544 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4626 var item = $$list.$index($$i); | 4545 var item = $$list[$$i]; |
| 4627 var arg = this.visitTypedValue(item, type); | 4546 var arg = this.visitTypedValue(item, type); |
| 4628 argValues.add$1(arg); | 4547 argValues.add$1(arg); |
| 4629 if (node.isConst && !arg.get$isConst()) { | 4548 if (node.isConst && !arg.get$isConst()) { |
| 4630 $globals.world.error("const list can only contain const values", arg.get$s pan()); | 4549 $globals.world.error("const list can only contain const values", arg.get$s pan()); |
| 4631 } | 4550 } |
| 4632 } | 4551 } |
| 4633 $globals.world.listFactoryType.markUsed(); | 4552 $globals.world.listFactoryType.markUsed(); |
| 4634 var ret = new ListValue(argValues, node.isConst, listType, node.span); | 4553 var ret = new ListValue(argValues, node.isConst, listType, node.span); |
| 4635 if (ret.get$isConst()) return ret.getGlobalValue$0(); | 4554 if (ret.get$isConst()) return ret.getGlobalValue$0(); |
| 4636 return ret; | 4555 return ret; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 4653 } | 4572 } |
| 4654 } | 4573 } |
| 4655 valueType = this.method.resolveType$2(node.valueType, true); | 4574 valueType = this.method.resolveType$2(node.valueType, true); |
| 4656 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h asTypeParams())) { | 4575 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h asTypeParams())) { |
| 4657 $globals.world.error("type parameter cannot be used in const map literals" ); | 4576 $globals.world.error("type parameter cannot be used in const map literals" ); |
| 4658 } | 4577 } |
| 4659 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); | 4578 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); |
| 4660 } | 4579 } |
| 4661 for (var i = (0); | 4580 for (var i = (0); |
| 4662 i < node.items.get$length(); i += (2)) { | 4581 i < node.items.get$length(); i += (2)) { |
| 4663 var key = this.visitTypedValue(node.items.$index(i), keyType); | 4582 var key = this.visitTypedValue(node.items[i], keyType); |
| 4664 if (node.isConst && !key.get$isConst()) { | 4583 if (node.isConst && !key.get$isConst()) { |
| 4665 $globals.world.error("const map can only contain const keys", key.get$span ()); | 4584 $globals.world.error("const map can only contain const keys", key.get$span ()); |
| 4666 } | 4585 } |
| 4667 values.add$1(key); | 4586 values.add$1(key); |
| 4668 var value = this.visitTypedValue(node.items.$index(i + (1)), valueType); | 4587 var value = this.visitTypedValue(node.items[i + (1)], valueType); |
| 4669 if (node.isConst && !value.get$isConst()) { | 4588 if (node.isConst && !value.get$isConst()) { |
| 4670 $globals.world.error("const map can only contain const values", value.get$ span()); | 4589 $globals.world.error("const map can only contain const values", value.get$ span()); |
| 4671 } | 4590 } |
| 4672 values.add$1(value); | 4591 values.add$1(value); |
| 4673 } | 4592 } |
| 4674 var ret = new MapValue(values, node.isConst, mapType, node.span); | 4593 var ret = new MapValue(values, node.isConst, mapType, node.span); |
| 4675 if (ret.get$isConst()) return ret.getGlobalValue$0(); | 4594 if (ret.get$isConst()) return ret.getGlobalValue$0(); |
| 4676 return ret; | 4595 return ret; |
| 4677 } | 4596 } |
| 4678 MethodGenerator.prototype.visitConditionalExpression = function(node) { | 4597 MethodGenerator.prototype.visitConditionalExpression = function(node) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4722 return u.op.kind == (16) || u.op.kind == (17); | 4641 return u.op.kind == (16) || u.op.kind == (17); |
| 4723 } | 4642 } |
| 4724 else { | 4643 else { |
| 4725 return false; | 4644 return false; |
| 4726 } | 4645 } |
| 4727 } | 4646 } |
| 4728 MethodGenerator.prototype.visitStringInterpExpression = function(node) { | 4647 MethodGenerator.prototype.visitStringInterpExpression = function(node) { |
| 4729 var items = []; | 4648 var items = []; |
| 4730 var $$list = node.pieces; | 4649 var $$list = node.pieces; |
| 4731 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4650 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4732 var item = $$list.$index($$i); | 4651 var item = $$list[$$i]; |
| 4733 var val = this.visitValue(item); | 4652 var val = this.visitValue(item); |
| 4734 val.invoke$4(this, "toString", item, Arguments.get$EMPTY()); | 4653 val.invoke$4(this, "toString", item, Arguments.get$EMPTY()); |
| 4735 var code = val.get$code(); | 4654 var code = val.get$code(); |
| 4736 if (this._expressionNeedsParens(item)) { | 4655 if (this._expressionNeedsParens(item)) { |
| 4737 code = ("(" + code + ")"); | 4656 code = ("(" + code + ")"); |
| 4738 } | 4657 } |
| 4739 if ($eq(items.get$length(), (0)) || ($ne(code, "''") && $ne(code, "\"\""))) { | 4658 if ($eq(items.get$length(), (0)) || ($ne(code, "''") && $ne(code, "\"\""))) { |
| 4740 items.add$1(code); | 4659 items.add$1(code); |
| 4741 } | 4660 } |
| 4742 } | 4661 } |
| 4743 return new Value($globals.world.stringType, ("(" + Strings.join(items, " + ") + ")"), node.span); | 4662 return new Value($globals.world.stringType, ("(" + Strings.join(items, " + ") + ")"), node.span); |
| 4744 } | 4663 } |
| 4745 MethodGenerator.prototype._checkNonStatic$1 = MethodGenerator.prototype._checkNo nStatic; | 4664 MethodGenerator.prototype._checkNonStatic$1 = MethodGenerator.prototype._checkNo nStatic; |
| 4746 MethodGenerator.prototype._pushBlock$1 = function($0) { | 4665 MethodGenerator.prototype._pushBlock$1 = function($0) { |
| 4747 return this._pushBlock($0, false); | 4666 return this._pushBlock($0, false); |
| 4748 }; | 4667 }; |
| 4749 MethodGenerator.prototype.evalBody$2 = MethodGenerator.prototype.evalBody; | 4668 MethodGenerator.prototype.evalBody$2 = MethodGenerator.prototype.evalBody; |
| 4750 MethodGenerator.prototype.run$0 = MethodGenerator.prototype.run; | 4669 MethodGenerator.prototype.run$0 = MethodGenerator.prototype.run; |
| 4670 MethodGenerator.prototype.visitAssertStatement$1 = MethodGenerator.prototype.vis itAssertStatement; | |
| 4751 MethodGenerator.prototype.visitBinaryExpression$1 = function($0) { | 4671 MethodGenerator.prototype.visitBinaryExpression$1 = function($0) { |
| 4752 return this.visitBinaryExpression($0, false); | 4672 return this.visitBinaryExpression($0, false); |
| 4753 }; | 4673 }; |
| 4674 MethodGenerator.prototype.visitBlockStatement$1 = MethodGenerator.prototype.visi tBlockStatement; | |
| 4675 MethodGenerator.prototype.visitBreakStatement$1 = MethodGenerator.prototype.visi tBreakStatement; | |
| 4676 MethodGenerator.prototype.visitContinueStatement$1 = MethodGenerator.prototype.v isitContinueStatement; | |
| 4677 MethodGenerator.prototype.visitDeclaredIdentifier$1 = MethodGenerator.prototype. visitDeclaredIdentifier; | |
| 4678 MethodGenerator.prototype.visitDietStatement$1 = MethodGenerator.prototype.visit DietStatement; | |
| 4679 MethodGenerator.prototype.visitDoStatement$1 = MethodGenerator.prototype.visitDo Statement; | |
| 4680 MethodGenerator.prototype.visitEmptyStatement$1 = MethodGenerator.prototype.visi tEmptyStatement; | |
| 4681 MethodGenerator.prototype.visitExpressionStatement$1 = MethodGenerator.prototype .visitExpressionStatement; | |
| 4682 MethodGenerator.prototype.visitForInStatement$1 = MethodGenerator.prototype.visi tForInStatement; | |
| 4683 MethodGenerator.prototype.visitForStatement$1 = MethodGenerator.prototype.visitF orStatement; | |
| 4684 MethodGenerator.prototype.visitFunctionDefinition$1 = MethodGenerator.prototype. visitFunctionDefinition; | |
| 4685 MethodGenerator.prototype.visitIfStatement$1 = MethodGenerator.prototype.visitIf Statement; | |
| 4686 MethodGenerator.prototype.visitIndexExpression$1 = MethodGenerator.prototype.vis itIndexExpression; | |
| 4687 MethodGenerator.prototype.visitLabeledStatement$1 = MethodGenerator.prototype.vi sitLabeledStatement; | |
| 4688 MethodGenerator.prototype.visitLambdaExpression$1 = MethodGenerator.prototype.vi sitLambdaExpression; | |
| 4689 MethodGenerator.prototype.visitLiteralExpression$1 = MethodGenerator.prototype.v isitLiteralExpression; | |
| 4690 MethodGenerator.prototype.visitMapExpression$1 = MethodGenerator.prototype.visit MapExpression; | |
| 4691 MethodGenerator.prototype.visitNewExpression$1 = MethodGenerator.prototype.visit NewExpression; | |
| 4754 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { | 4692 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { |
| 4755 return this.visitPostfixExpression($0, false); | 4693 return this.visitPostfixExpression($0, false); |
| 4756 }; | 4694 }; |
| 4695 MethodGenerator.prototype.visitReturnStatement$1 = MethodGenerator.prototype.vis itReturnStatement; | |
| 4696 MethodGenerator.prototype.visitSwitchStatement$1 = MethodGenerator.prototype.vis itSwitchStatement; | |
| 4697 MethodGenerator.prototype.visitThrowStatement$1 = MethodGenerator.prototype.visi tThrowStatement; | |
| 4698 MethodGenerator.prototype.visitTryStatement$1 = MethodGenerator.prototype.visitT ryStatement; | |
| 4699 MethodGenerator.prototype.visitVariableDefinition$1 = MethodGenerator.prototype. visitVariableDefinition; | |
| 4700 MethodGenerator.prototype.visitWhileStatement$1 = MethodGenerator.prototype.visi tWhileStatement; | |
| 4757 MethodGenerator.prototype.writeDefinition$2 = MethodGenerator.prototype.writeDef inition; | 4701 MethodGenerator.prototype.writeDefinition$2 = MethodGenerator.prototype.writeDef inition; |
| 4758 // ********** Code for Arguments ************** | 4702 // ********** Code for Arguments ************** |
| 4759 function Arguments(nodes, values) { | 4703 function Arguments(nodes, values) { |
| 4760 this.nodes = nodes; | 4704 this.nodes = nodes; |
| 4761 this.values = values; | 4705 this.values = values; |
| 4762 } | 4706 } |
| 4763 Arguments.Arguments$bare$factory = function(arity) { | 4707 Arguments.Arguments$bare$factory = function(arity) { |
| 4764 var values = []; | 4708 var values = []; |
| 4765 for (var i = (0); | 4709 for (var i = (0); |
| 4766 i < arity; i++) { | 4710 i < arity; i++) { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 4777 Arguments.prototype.get$nameCount = function() { | 4721 Arguments.prototype.get$nameCount = function() { |
| 4778 return this.get$length() - this.get$bareCount(); | 4722 return this.get$length() - this.get$bareCount(); |
| 4779 } | 4723 } |
| 4780 Arguments.prototype.get$hasNames = function() { | 4724 Arguments.prototype.get$hasNames = function() { |
| 4781 return this.get$bareCount() < this.get$length(); | 4725 return this.get$bareCount() < this.get$length(); |
| 4782 } | 4726 } |
| 4783 Arguments.prototype.get$length = function() { | 4727 Arguments.prototype.get$length = function() { |
| 4784 return this.values.get$length(); | 4728 return this.values.get$length(); |
| 4785 } | 4729 } |
| 4786 Arguments.prototype.getName = function(i) { | 4730 Arguments.prototype.getName = function(i) { |
| 4787 return this.nodes.$index(i).get$label().get$name(); | 4731 return this.nodes[i].get$label().get$name(); |
| 4788 } | 4732 } |
| 4789 Arguments.prototype.getIndexOfName = function(name) { | 4733 Arguments.prototype.getIndexOfName = function(name) { |
| 4790 for (var i = this.get$bareCount(); | 4734 for (var i = this.get$bareCount(); |
| 4791 i < this.get$length(); i++) { | 4735 i < this.get$length(); i++) { |
| 4792 if (this.getName(i) == name) { | 4736 if (this.getName(i) == name) { |
| 4793 return i; | 4737 return i; |
| 4794 } | 4738 } |
| 4795 } | 4739 } |
| 4796 return (-1); | 4740 return (-1); |
| 4797 } | 4741 } |
| 4798 Arguments.prototype.getValue = function(name) { | 4742 Arguments.prototype.getValue = function(name) { |
| 4799 var i = this.getIndexOfName(name); | 4743 var i = this.getIndexOfName(name); |
| 4800 return i >= (0) ? this.values.$index(i) : null; | 4744 return i >= (0) ? this.values[i] : null; |
| 4801 } | 4745 } |
| 4802 Arguments.prototype.get$bareCount = function() { | 4746 Arguments.prototype.get$bareCount = function() { |
| 4803 if (this._bareCount == null) { | 4747 if (this._bareCount == null) { |
| 4804 this._bareCount = this.get$length(); | 4748 this._bareCount = this.get$length(); |
| 4805 if (this.nodes != null) { | 4749 if (this.nodes != null) { |
| 4806 for (var i = (0); | 4750 for (var i = (0); |
| 4807 i < this.nodes.get$length(); i++) { | 4751 i < this.nodes.get$length(); i++) { |
| 4808 if (this.nodes.$index(i).get$label() != null) { | 4752 if (this.nodes[i].get$label() != null) { |
| 4809 this._bareCount = i; | 4753 this._bareCount = i; |
| 4810 break; | 4754 break; |
| 4811 } | 4755 } |
| 4812 } | 4756 } |
| 4813 } | 4757 } |
| 4814 } | 4758 } |
| 4815 return this._bareCount; | 4759 return this._bareCount; |
| 4816 } | 4760 } |
| 4817 Arguments.prototype.getCode = function() { | 4761 Arguments.prototype.getCode = function() { |
| 4818 var argsCode = []; | 4762 var argsCode = []; |
| 4819 for (var i = (0); | 4763 for (var i = (0); |
| 4820 i < this.get$length(); i++) { | 4764 i < this.get$length(); i++) { |
| 4821 argsCode.add$1(this.values.$index(i).get$code()); | 4765 argsCode.add$1(this.values[i].get$code()); |
| 4822 } | 4766 } |
| 4823 Arguments.removeTrailingNulls(argsCode); | 4767 Arguments.removeTrailingNulls(argsCode); |
| 4824 return Strings.join(argsCode, ", "); | 4768 return Strings.join(argsCode, ", "); |
| 4825 } | 4769 } |
| 4826 Arguments.removeTrailingNulls = function(argsCode) { | 4770 Arguments.removeTrailingNulls = function(argsCode) { |
| 4827 while (argsCode.get$length() > (0) && $eq(argsCode.last$0(), "null")) { | 4771 while (argsCode.get$length() > (0) && $eq(argsCode.last(), "null")) { |
| 4828 argsCode.removeLast$0(); | 4772 argsCode.removeLast(); |
| 4829 } | 4773 } |
| 4830 } | 4774 } |
| 4831 Arguments.prototype.getNames = function() { | 4775 Arguments.prototype.getNames = function() { |
| 4832 var names = []; | 4776 var names = []; |
| 4833 for (var i = this.get$bareCount(); | 4777 for (var i = this.get$bareCount(); |
| 4834 i < this.get$length(); i++) { | 4778 i < this.get$length(); i++) { |
| 4835 names.add$1(this.getName(i)); | 4779 names.add$1(this.getName(i)); |
| 4836 } | 4780 } |
| 4837 return names; | 4781 return names; |
| 4838 } | 4782 } |
| 4839 Arguments.prototype.toCallStubArgs = function() { | 4783 Arguments.prototype.toCallStubArgs = function() { |
| 4840 var result = []; | 4784 var result = []; |
| 4841 for (var i = (0); | 4785 for (var i = (0); |
| 4842 i < this.get$bareCount(); i++) { | 4786 i < this.get$bareCount(); i++) { |
| 4843 result.add$1(new VariableValue($globals.world.varType, ("$" + i), null, fals e)); | 4787 result.add$1(new VariableValue($globals.world.varType, ("$" + i), null, fals e)); |
| 4844 } | 4788 } |
| 4845 for (var i = this.get$bareCount(); | 4789 for (var i = this.get$bareCount(); |
| 4846 i < this.get$length(); i++) { | 4790 i < this.get$length(); i++) { |
| 4847 var name = this.getName(i); | 4791 var name = this.getName(i); |
| 4848 if (name == null) name = ("$" + i); | 4792 if (name == null) name = ("$" + i); |
| 4849 result.add$1(new VariableValue($globals.world.varType, name, null, false)); | 4793 result.add$1(new VariableValue($globals.world.varType, name, null, false)); |
| 4850 } | 4794 } |
| 4851 return new Arguments(this.nodes, result); | 4795 return new Arguments(this.nodes, result); |
| 4852 } | 4796 } |
| 4797 // ********** Code for ReturnKind ************** | |
| 4798 function ReturnKind() {} | |
| 4853 // ********** Code for LibraryImport ************** | 4799 // ********** Code for LibraryImport ************** |
| 4854 function LibraryImport(library, prefix, span) { | 4800 function LibraryImport(library, prefix, span) { |
| 4855 this.library = library; | 4801 this.library = library; |
| 4856 this.span = span; | 4802 this.span = span; |
| 4857 this.prefix = prefix; | 4803 this.prefix = prefix; |
| 4858 } | 4804 } |
| 4859 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; | 4805 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; |
| 4860 LibraryImport.prototype.get$library = function() { return this.library; }; | 4806 LibraryImport.prototype.get$library = function() { return this.library; }; |
| 4861 LibraryImport.prototype.get$span = function() { return this.span; }; | 4807 LibraryImport.prototype.get$span = function() { return this.span; }; |
| 4862 // ********** Code for Member ************** | 4808 // ********** Code for Member ************** |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4942 return $globals.world.nonNullBool; | 4888 return $globals.world.nonNullBool; |
| 4943 } | 4889 } |
| 4944 return t; | 4890 return t; |
| 4945 } | 4891 } |
| 4946 Member.prototype.get$definition = function() { | 4892 Member.prototype.get$definition = function() { |
| 4947 return null; | 4893 return null; |
| 4948 } | 4894 } |
| 4949 Member.prototype.get$parameters = function() { | 4895 Member.prototype.get$parameters = function() { |
| 4950 return []; | 4896 return []; |
| 4951 } | 4897 } |
| 4898 Member.prototype.get$preciseMemberSet = function() { | |
| 4899 if (this._preciseMemberSet == null) { | |
| 4900 this._preciseMemberSet = new MemberSet(this, false); | |
| 4901 } | |
| 4902 return this._preciseMemberSet; | |
| 4903 } | |
| 4904 Member.prototype.get$potentialMemberSet = function() { | |
| 4905 if (this._potentialMemberSet == null) { | |
| 4906 if (this.declaringType.get$isObject()) { | |
| 4907 this._potentialMemberSet = $globals.world._members.$index(this.name); | |
| 4908 return this._potentialMemberSet; | |
| 4909 } | |
| 4910 var mems = new HashSetImplementation(); | |
| 4911 if (this.declaringType.get$isClass()) mems.add$1(this); | |
| 4912 var $$list = this.declaringType.get$subtypes(); | |
| 4913 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | |
| 4914 var subtype = $$i.next$0(); | |
| 4915 if (!subtype.get$isClass()) continue; | |
| 4916 var mem = subtype.get$members().$index(this.name); | |
| 4917 if (mem != null) { | |
| 4918 mems.add$1(mem); | |
| 4919 } | |
| 4920 else if (!this.declaringType.get$isClass()) { | |
| 4921 mem = subtype.getMember$1(this.name); | |
| 4922 if (mem != null) { | |
| 4923 mems.add$1(mem); | |
| 4924 } | |
| 4925 } | |
| 4926 } | |
| 4927 if ($ne(mems.get$length(), (0))) { | |
| 4928 for (var $$i = mems.iterator$0(); $$i.hasNext$0(); ) { | |
| 4929 var mem = $$i.next$0(); | |
| 4930 if (this._potentialMemberSet == null) { | |
| 4931 this._potentialMemberSet = new MemberSet(mem, false); | |
| 4932 } | |
| 4933 else { | |
| 4934 this._potentialMemberSet.add(mem); | |
| 4935 } | |
| 4936 } | |
| 4937 } | |
| 4938 } | |
| 4939 return this._potentialMemberSet; | |
| 4940 } | |
| 4952 Member.prototype.canInvoke = function(context, args) { | 4941 Member.prototype.canInvoke = function(context, args) { |
| 4953 return this.get$canGet() && new Value(this.get$returnType(), null, null).canIn voke(context, ":call", args); | 4942 return this.get$canGet() && new Value(this.get$returnType(), null, null).canIn voke(context, ":call", args); |
| 4954 } | 4943 } |
| 4955 Member.prototype.invoke = function(context, node, target, args, isDynamic) { | 4944 Member.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 4956 var newTarget = this._get(context, node, target, isDynamic); | 4945 var newTarget = this._get(context, node, target, isDynamic); |
| 4957 return newTarget.invoke$5(context, ":call", node, args, isDynamic); | 4946 return newTarget.invoke$5(context, ":call", node, args, isDynamic); |
| 4958 } | 4947 } |
| 4959 Member.prototype.override = function(other) { | 4948 Member.prototype.override = function(other) { |
| 4960 if (this.get$isStatic()) { | 4949 if (this.get$isStatic()) { |
| 4961 $globals.world.error("static members can not hide parent members", this.get$ span(), other.get$span()); | 4950 $globals.world.error("static members can not hide parent members", this.get$ span(), other.get$span()); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 4980 var typeCode = this.declaringType == null ? (1) : this.declaringType.hashCode( ); | 4969 var typeCode = this.declaringType == null ? (1) : this.declaringType.hashCode( ); |
| 4981 var nameCode = this.get$isConstructor() ? this.get$constructorName().hashCode( ) : this.name.hashCode(); | 4970 var nameCode = this.get$isConstructor() ? this.get$constructorName().hashCode( ) : this.name.hashCode(); |
| 4982 return (typeCode << (4)) ^ nameCode; | 4971 return (typeCode << (4)) ^ nameCode; |
| 4983 } | 4972 } |
| 4984 Member.prototype.$eq = function(other) { | 4973 Member.prototype.$eq = function(other) { |
| 4985 return (other instanceof Member) && $eq(this.get$isConstructor(), other.get$is Constructor()) && $eq(this.declaringType, other.get$declaringType()) && (this.ge t$isConstructor() ? this.get$constructorName() == other.get$constructorName() : this.name == other.get$name()); | 4974 return (other instanceof Member) && $eq(this.get$isConstructor(), other.get$is Constructor()) && $eq(this.declaringType, other.get$declaringType()) && (this.ge t$isConstructor() ? this.get$constructorName() == other.get$constructorName() : this.name == other.get$name()); |
| 4986 } | 4975 } |
| 4987 Member.prototype._get$3 = Member.prototype._get; | 4976 Member.prototype._get$3 = Member.prototype._get; |
| 4988 Member.prototype._get$3$isDynamic = Member.prototype._get; | 4977 Member.prototype._get$3$isDynamic = Member.prototype._get; |
| 4989 Member.prototype._get$4 = Member.prototype._get; | 4978 Member.prototype._get$4 = Member.prototype._get; |
| 4990 Member.prototype._set$4 = Member.prototype._set; | |
| 4991 Member.prototype._set$4$isDynamic = Member.prototype._set; | 4979 Member.prototype._set$4$isDynamic = Member.prototype._set; |
| 4992 Member.prototype._set$5 = Member.prototype._set; | 4980 Member.prototype._set$5 = Member.prototype._set; |
| 4993 Member.prototype.canInvoke$2 = Member.prototype.canInvoke; | 4981 Member.prototype.canInvoke$2 = Member.prototype.canInvoke; |
| 4994 Member.prototype.computeValue$0 = Member.prototype.computeValue; | 4982 Member.prototype.computeValue$0 = Member.prototype.computeValue; |
| 4995 Member.prototype.hashCode$0 = Member.prototype.hashCode; | 4983 Member.prototype.hashCode$0 = Member.prototype.hashCode; |
| 4996 Member.prototype.invoke$4 = function($0, $1, $2, $3) { | 4984 Member.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 4997 return this.invoke($0, $1, $2, $3, false); | 4985 return this.invoke($0, $1, $2, $3, false); |
| 4998 }; | 4986 }; |
| 4999 Member.prototype.invoke$4$isDynamic = Member.prototype.invoke; | 4987 Member.prototype.invoke$4$isDynamic = Member.prototype.invoke; |
| 5000 Member.prototype.invoke$5 = Member.prototype.invoke; | 4988 Member.prototype.invoke$5 = Member.prototype.invoke; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5079 Library.prototype._addMember = function(member) { | 5067 Library.prototype._addMember = function(member) { |
| 5080 if (member.get$isPrivate()) { | 5068 if (member.get$isPrivate()) { |
| 5081 if (member.get$isStatic()) { | 5069 if (member.get$isStatic()) { |
| 5082 if (member.declaringType.get$isTop()) { | 5070 if (member.declaringType.get$isTop()) { |
| 5083 $globals.world._addTopName(member); | 5071 $globals.world._addTopName(member); |
| 5084 } | 5072 } |
| 5085 return; | 5073 return; |
| 5086 } | 5074 } |
| 5087 var mset = this._privateMembers.$index(member.name); | 5075 var mset = this._privateMembers.$index(member.name); |
| 5088 if (mset == null) { | 5076 if (mset == null) { |
| 5089 var $$list = $globals.world.libraries.getValues$0(); | 5077 var $$list = $globals.world.libraries.getValues(); |
| 5090 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5078 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5091 var lib = $$i.next$0(); | 5079 var lib = $$i.next$0(); |
| 5092 if (lib.get$_privateMembers().containsKey$1(member.get$jsname())) { | 5080 if (lib.get$_privateMembers().containsKey$1(member.get$jsname())) { |
| 5093 member._jsname = ("_" + this.get$jsname() + member.get$jsname()); | 5081 member._jsname = ("_" + this.get$jsname() + member.get$jsname()); |
| 5094 break; | 5082 break; |
| 5095 } | 5083 } |
| 5096 } | 5084 } |
| 5097 mset = new MemberSet(member, true); | 5085 mset = new MemberSet(member, true); |
| 5098 this._privateMembers.$setindex(member.name, mset); | 5086 this._privateMembers.$setindex(member.name, mset); |
| 5099 } | 5087 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5133 Library.prototype.findType = function(type) { | 5121 Library.prototype.findType = function(type) { |
| 5134 var result = this.findTypeByName(type.name.name); | 5122 var result = this.findTypeByName(type.name.name); |
| 5135 if (result == null) return null; | 5123 if (result == null) return null; |
| 5136 if (type.names != null) { | 5124 if (type.names != null) { |
| 5137 if (type.names.get$length() > (1)) { | 5125 if (type.names.get$length() > (1)) { |
| 5138 return null; | 5126 return null; |
| 5139 } | 5127 } |
| 5140 if (!result.get$isTop()) { | 5128 if (!result.get$isTop()) { |
| 5141 return null; | 5129 return null; |
| 5142 } | 5130 } |
| 5143 return result.get$library().findTypeByName(type.names.$index((0)).get$name() ); | 5131 return result.get$library().findTypeByName(type.names[(0)].get$name()); |
| 5144 } | 5132 } |
| 5145 return result; | 5133 return result; |
| 5146 } | 5134 } |
| 5147 Library.prototype.findTypeByName = function(name) { | 5135 Library.prototype.findTypeByName = function(name) { |
| 5148 var ret = this.types.$index(name); | 5136 var ret = this.types.$index(name); |
| 5149 var $$list = this.imports; | 5137 var $$list = this.imports; |
| 5150 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5138 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5151 var imported = $$list.$index($$i); | 5139 var imported = $$list[$$i]; |
| 5152 var newRet = null; | 5140 var newRet = null; |
| 5153 if (imported.get$prefix() == null) { | 5141 if (imported.get$prefix() == null) { |
| 5154 newRet = imported.get$library().get$types().$index(name); | 5142 newRet = imported.get$library().get$types().$index(name); |
| 5155 } | 5143 } |
| 5156 else if ($eq(imported.get$prefix(), name)) { | 5144 else if ($eq(imported.get$prefix(), name)) { |
| 5157 newRet = imported.get$library().get$topType(); | 5145 newRet = imported.get$library().get$topType(); |
| 5158 } | 5146 } |
| 5159 if (newRet != null) { | 5147 if (newRet != null) { |
| 5160 if (ret != null && $ne(ret, newRet)) { | 5148 if (ret != null && $ne(ret, newRet)) { |
| 5161 $globals.world.error(("conflicting types for \"" + name + "\""), ret.get $span(), newRet.get$span()); | 5149 $globals.world.error(("conflicting types for \"" + name + "\""), ret.get $span(), newRet.get$span()); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5205 var index = this.name.lastIndexOf("/", this.name.length); | 5193 var index = this.name.lastIndexOf("/", this.name.length); |
| 5206 if (index >= (0)) { | 5194 if (index >= (0)) { |
| 5207 this.name = this.name.substring($add(index, (1))); | 5195 this.name = this.name.substring($add(index, (1))); |
| 5208 } | 5196 } |
| 5209 index = this.name.indexOf("."); | 5197 index = this.name.indexOf("."); |
| 5210 if (index > (0)) { | 5198 if (index > (0)) { |
| 5211 this.name = this.name.substring((0), index); | 5199 this.name = this.name.substring((0), index); |
| 5212 } | 5200 } |
| 5213 } | 5201 } |
| 5214 this._jsname = this.name.replaceAll(".", "_").replaceAll(":", "_").replaceAll( " ", "_"); | 5202 this._jsname = this.name.replaceAll(".", "_").replaceAll(":", "_").replaceAll( " ", "_"); |
| 5215 var $$list = this.types.getValues$0(); | 5203 var $$list = this.types.getValues(); |
| 5216 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5204 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5217 var type = $$i.next$0(); | 5205 var type = $$i.next$0(); |
| 5218 type.resolve$0(); | 5206 type.resolve$0(); |
| 5219 } | 5207 } |
| 5220 } | 5208 } |
| 5221 Library.prototype._addTopName = function(name, member, localSpan) { | 5209 Library.prototype._addTopName = function(name, member, localSpan) { |
| 5222 var existing = this._topNames.$index(name); | 5210 var existing = this._topNames.$index(name); |
| 5223 if (existing == null) { | 5211 if (existing == null) { |
| 5224 this._topNames.$setindex(name, member); | 5212 this._topNames.$setindex(name, member); |
| 5225 } | 5213 } |
| 5226 else { | 5214 else { |
| 5227 if ((existing instanceof AmbiguousMember)) { | 5215 if ((existing instanceof AmbiguousMember)) { |
| 5228 existing.get$members().add$1(member); | 5216 existing.get$members().add$1(member); |
| 5229 } | 5217 } |
| 5230 else { | 5218 else { |
| 5231 var newMember = new AmbiguousMember(name, [existing, member]); | 5219 var newMember = new AmbiguousMember(name, [existing, member]); |
| 5232 $globals.world.error(("conflicting members for \"" + name + "\""), existin g.get$span(), member.get$span(), localSpan); | 5220 $globals.world.error(("conflicting members for \"" + name + "\""), existin g.get$span(), member.get$span(), localSpan); |
| 5233 this._topNames.$setindex(name, newMember); | 5221 this._topNames.$setindex(name, newMember); |
| 5234 } | 5222 } |
| 5235 } | 5223 } |
| 5236 } | 5224 } |
| 5237 Library.prototype._addTopNames = function(lib) { | 5225 Library.prototype._addTopNames = function(lib) { |
| 5238 var $$list = lib.topType.members.getValues$0(); | 5226 var $$list = lib.topType.members.getValues(); |
| 5239 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5227 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5240 var member = $$i.next$0(); | 5228 var member = $$i.next$0(); |
| 5241 if (member.get$isPrivate() && $ne(lib, this)) continue; | 5229 if (member.get$isPrivate() && $ne(lib, this)) continue; |
| 5242 this._addTopName(member.get$name(), member); | 5230 this._addTopName(member.get$name(), member); |
| 5243 } | 5231 } |
| 5244 var $$list = lib.types.getValues$0(); | 5232 var $$list = lib.types.getValues(); |
| 5245 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5233 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5246 var type = $$i.next$0(); | 5234 var type = $$i.next$0(); |
| 5247 if (!type.get$isTop()) { | 5235 if (!type.get$isTop()) { |
| 5248 if ($ne(lib, this) && type.get$typeMember().get$isPrivate()) continue; | 5236 if ($ne(lib, this) && type.get$typeMember().get$isPrivate()) continue; |
| 5249 this._addTopName(type.get$name(), type.get$typeMember()); | 5237 this._addTopName(type.get$name(), type.get$typeMember()); |
| 5250 } | 5238 } |
| 5251 } | 5239 } |
| 5252 } | 5240 } |
| 5253 Library.prototype.postResolveChecks = function() { | 5241 Library.prototype.postResolveChecks = function() { |
| 5254 this._topNames = new HashMapImplementation(); | 5242 this._topNames = new HashMapImplementation(); |
| 5255 this._addTopNames(this); | 5243 this._addTopNames(this); |
| 5256 var $$list = this.imports; | 5244 var $$list = this.imports; |
| 5257 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5245 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5258 var imported = $$list.$index($$i); | 5246 var imported = $$list[$$i]; |
| 5259 if (imported.get$prefix() == null) { | 5247 if (imported.get$prefix() == null) { |
| 5260 this._addTopNames(imported.get$library()); | 5248 this._addTopNames(imported.get$library()); |
| 5261 } | 5249 } |
| 5262 else { | 5250 else { |
| 5263 this._addTopName(imported.get$prefix(), imported.get$library().get$topType ().get$typeMember(), imported.get$span()); | 5251 this._addTopName(imported.get$prefix(), imported.get$library().get$topType ().get$typeMember(), imported.get$span()); |
| 5264 } | 5252 } |
| 5265 } | 5253 } |
| 5266 } | 5254 } |
| 5267 Library.prototype.visitSources = function() { | 5255 Library.prototype.visitSources = function() { |
| 5268 var visitor = new _LibraryVisitor(this); | 5256 var visitor = new _LibraryVisitor(this); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5419 _LibraryVisitor.prototype.getSingleStringArg = function(node) { | 5407 _LibraryVisitor.prototype.getSingleStringArg = function(node) { |
| 5420 if (node.arguments.get$length() != (1)) { | 5408 if (node.arguments.get$length() != (1)) { |
| 5421 $globals.world.error(("expected exactly one argument but found " + node.argu ments.get$length()), node.span); | 5409 $globals.world.error(("expected exactly one argument but found " + node.argu ments.get$length()), node.span); |
| 5422 } | 5410 } |
| 5423 return this.getFirstStringArg(node); | 5411 return this.getFirstStringArg(node); |
| 5424 } | 5412 } |
| 5425 _LibraryVisitor.prototype.getFirstStringArg = function(node) { | 5413 _LibraryVisitor.prototype.getFirstStringArg = function(node) { |
| 5426 if (node.arguments.get$length() < (1)) { | 5414 if (node.arguments.get$length() < (1)) { |
| 5427 $globals.world.error(("expected at least one argument but found " + node.arg uments.get$length()), node.span); | 5415 $globals.world.error(("expected at least one argument but found " + node.arg uments.get$length()), node.span); |
| 5428 } | 5416 } |
| 5429 var arg = node.arguments.$index((0)); | 5417 var arg = node.arguments[(0)]; |
| 5430 if (arg.get$label() != null) { | 5418 if (arg.get$label() != null) { |
| 5431 $globals.world.error("label not allowed for directive", node.span); | 5419 $globals.world.error("label not allowed for directive", node.span); |
| 5432 } | 5420 } |
| 5433 return this._parseStringArgument(arg); | 5421 return this._parseStringArgument(arg); |
| 5434 } | 5422 } |
| 5435 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { | 5423 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { |
| 5436 var args = node.arguments.filter$1((function (a) { | 5424 var args = node.arguments.filter$1((function (a) { |
| 5437 return a.get$label() != null && $eq(a.get$label().get$name(), argName); | 5425 return a.get$label() != null && $eq(a.get$label().get$name(), argName); |
| 5438 }) | 5426 }) |
| 5439 ); | 5427 ); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 5453 if (!(expr instanceof LiteralExpression) || !expr.get$value().get$type().get$i sString()) { | 5441 if (!(expr instanceof LiteralExpression) || !expr.get$value().get$type().get$i sString()) { |
| 5454 $globals.world.error("expected string literal", expr.get$span()); | 5442 $globals.world.error("expected string literal", expr.get$span()); |
| 5455 } | 5443 } |
| 5456 return expr.get$value().get$actualValue(); | 5444 return expr.get$value().get$actualValue(); |
| 5457 } | 5445 } |
| 5458 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { | 5446 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { |
| 5459 var oldType = this.currentType; | 5447 var oldType = this.currentType; |
| 5460 this.currentType = this.library.addType(node.name.name, node, node.isClass); | 5448 this.currentType = this.library.addType(node.name.name, node, node.isClass); |
| 5461 var $$list = node.body; | 5449 var $$list = node.body; |
| 5462 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5450 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5463 var member = $$list.$index($$i); | 5451 var member = $$list[$$i]; |
| 5464 member.visit$1(this); | 5452 member.visit$1(this); |
| 5465 } | 5453 } |
| 5466 this.currentType = oldType; | 5454 this.currentType = oldType; |
| 5467 } | 5455 } |
| 5468 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { | 5456 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { |
| 5469 this.currentType.addField(node); | 5457 this.currentType.addField(node); |
| 5470 } | 5458 } |
| 5471 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { | 5459 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { |
| 5472 this.currentType.addMethod(node.name.name, node); | 5460 this.currentType.addMethod(node.name.name, node); |
| 5473 } | 5461 } |
| 5474 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { | 5462 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { |
| 5475 var type = this.library.addType(node.func.name.name, node, false); | 5463 var type = this.library.addType(node.func.name.name, node, false); |
| 5476 type.addMethod$2(":call", node.func); | 5464 type.addMethod$2(":call", node.func); |
| 5477 } | 5465 } |
| 5478 _LibraryVisitor.prototype.addSource$1 = _LibraryVisitor.prototype.addSource; | 5466 _LibraryVisitor.prototype.addSource$1 = _LibraryVisitor.prototype.addSource; |
| 5467 _LibraryVisitor.prototype.visitFunctionDefinition$1 = _LibraryVisitor.prototype. visitFunctionDefinition; | |
| 5468 _LibraryVisitor.prototype.visitVariableDefinition$1 = _LibraryVisitor.prototype. visitVariableDefinition; | |
| 5479 // ********** Code for Parameter ************** | 5469 // ********** Code for Parameter ************** |
| 5480 function Parameter(definition, method) { | 5470 function Parameter(definition, method) { |
| 5481 this.method = method; | 5471 this.method = method; |
| 5482 this.definition = definition; | 5472 this.definition = definition; |
| 5483 this.isInitializer = false; | 5473 this.isInitializer = false; |
| 5484 } | 5474 } |
| 5485 Parameter.prototype.get$definition = function() { return this.definition; }; | 5475 Parameter.prototype.get$definition = function() { return this.definition; }; |
| 5486 Parameter.prototype.set$definition = function(value) { return this.definition = value; }; | 5476 Parameter.prototype.set$definition = function(value) { return this.definition = value; }; |
| 5487 Parameter.prototype.get$method = function() { return this.method; }; | 5477 Parameter.prototype.get$method = function() { return this.method; }; |
| 5488 Parameter.prototype.set$method = function(value) { return this.method = value; } ; | 5478 Parameter.prototype.set$method = function(value) { return this.method = value; } ; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5579 $globals.world.error("cannot set type", node.span); | 5569 $globals.world.error("cannot set type", node.span); |
| 5580 } | 5570 } |
| 5581 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { | 5571 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 5582 $globals.world.error("cannot invoke type", node.span); | 5572 $globals.world.error("cannot invoke type", node.span); |
| 5583 } | 5573 } |
| 5584 TypeMember.prototype._get$3 = function($0, $1, $2) { | 5574 TypeMember.prototype._get$3 = function($0, $1, $2) { |
| 5585 return this._get($0, $1, $2, false); | 5575 return this._get($0, $1, $2, false); |
| 5586 }; | 5576 }; |
| 5587 TypeMember.prototype._get$3$isDynamic = TypeMember.prototype._get; | 5577 TypeMember.prototype._get$3$isDynamic = TypeMember.prototype._get; |
| 5588 TypeMember.prototype._get$4 = TypeMember.prototype._get; | 5578 TypeMember.prototype._get$4 = TypeMember.prototype._get; |
| 5589 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { | |
| 5590 return this._set($0, $1, $2, $3, false); | |
| 5591 }; | |
| 5592 TypeMember.prototype._set$4$isDynamic = TypeMember.prototype._set; | 5579 TypeMember.prototype._set$4$isDynamic = TypeMember.prototype._set; |
| 5593 TypeMember.prototype._set$5 = TypeMember.prototype._set; | 5580 TypeMember.prototype._set$5 = TypeMember.prototype._set; |
| 5594 TypeMember.prototype.canInvoke$2 = TypeMember.prototype.canInvoke; | 5581 TypeMember.prototype.canInvoke$2 = TypeMember.prototype.canInvoke; |
| 5595 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 5582 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 5596 return this.invoke($0, $1, $2, $3, false); | 5583 return this.invoke($0, $1, $2, $3, false); |
| 5597 }; | 5584 }; |
| 5598 TypeMember.prototype.invoke$4$isDynamic = TypeMember.prototype.invoke; | 5585 TypeMember.prototype.invoke$4$isDynamic = TypeMember.prototype.invoke; |
| 5599 TypeMember.prototype.invoke$5 = TypeMember.prototype.invoke; | 5586 TypeMember.prototype.invoke$5 = TypeMember.prototype.invoke; |
| 5600 // ********** Code for FieldMember ************** | 5587 // ********** Code for FieldMember ************** |
| 5601 $inherits(FieldMember, Member); | 5588 $inherits(FieldMember, Member); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5646 } | 5633 } |
| 5647 FieldMember.prototype.get$isField = function() { | 5634 FieldMember.prototype.get$isField = function() { |
| 5648 return true; | 5635 return true; |
| 5649 } | 5636 } |
| 5650 FieldMember.prototype.resolve = function() { | 5637 FieldMember.prototype.resolve = function() { |
| 5651 this.isStatic = this.declaringType.get$isTop(); | 5638 this.isStatic = this.declaringType.get$isTop(); |
| 5652 this.isFinal = false; | 5639 this.isFinal = false; |
| 5653 if (this.definition.modifiers != null) { | 5640 if (this.definition.modifiers != null) { |
| 5654 var $$list = this.definition.modifiers; | 5641 var $$list = this.definition.modifiers; |
| 5655 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5642 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5656 var mod = $$list.$index($$i); | 5643 var mod = $$list[$$i]; |
| 5657 if ($eq(mod.get$kind(), (85))) { | 5644 if ($eq(mod.get$kind(), (85))) { |
| 5658 if (this.isStatic) { | 5645 if (this.isStatic) { |
| 5659 $globals.world.error("duplicate static modifier", mod.get$span()); | 5646 $globals.world.error("duplicate static modifier", mod.get$span()); |
| 5660 } | 5647 } |
| 5661 this.isStatic = true; | 5648 this.isStatic = true; |
| 5662 } | 5649 } |
| 5663 else if ($eq(mod.get$kind(), (99))) { | 5650 else if ($eq(mod.get$kind(), (99))) { |
| 5664 if (this.isFinal) { | 5651 if (this.isFinal) { |
| 5665 $globals.world.error("duplicate final modifier", mod.get$span()); | 5652 $globals.world.error("duplicate final modifier", mod.get$span()); |
| 5666 } | 5653 } |
| 5667 this.isFinal = true; | 5654 this.isFinal = true; |
| 5668 } | 5655 } |
| 5669 else { | 5656 else { |
| 5670 $globals.world.error(("" + mod + " modifier not allowed on field"), mod. get$span()); | 5657 $globals.world.error(("" + mod + " modifier not allowed on field"), mod. get$span()); |
| 5671 } | 5658 } |
| 5672 } | 5659 } |
| 5673 } | 5660 } |
| 5674 this.type = this.resolveType(this.definition.type, false); | 5661 this.type = this.resolveType$2(this.definition.type, false); |
| 5675 if (this.isStatic && !this.get$isFactory() && this.type.get$hasTypeParams()) { | 5662 if (this.isStatic && !this.get$isFactory() && this.type.get$hasTypeParams()) { |
| 5676 $globals.world.error("using type parameter in static context", this.definiti on.type.span); | 5663 $globals.world.error("using type parameter in static context", this.definiti on.type.span); |
| 5677 } | 5664 } |
| 5678 if (this.isStatic && this.isFinal && this.value == null) { | 5665 if (this.isStatic && this.isFinal && this.value == null) { |
| 5679 $globals.world.error("static final field is missing initializer", this.get$s pan()); | 5666 $globals.world.error("static final field is missing initializer", this.get$s pan()); |
| 5680 } | 5667 } |
| 5681 this.get$library()._addMember(this); | 5668 this.get$library()._addMember(this); |
| 5682 } | 5669 } |
| 5683 FieldMember.prototype.computeValue = function() { | 5670 FieldMember.prototype.computeValue = function() { |
| 5684 if (this.value == null) return null; | 5671 if (this.value == null) return null; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5752 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { | 5739 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { |
| 5753 var lhs = this._get(context, node, target, isDynamic); | 5740 var lhs = this._get(context, node, target, isDynamic); |
| 5754 value = value.convertTo(context, this.type, isDynamic); | 5741 value = value.convertTo(context, this.type, isDynamic); |
| 5755 return new Value(this.type, ("" + lhs.get$code() + " = " + value.get$code()), node.span); | 5742 return new Value(this.type, ("" + lhs.get$code() + " = " + value.get$code()), node.span); |
| 5756 } | 5743 } |
| 5757 FieldMember.prototype._get$3 = function($0, $1, $2) { | 5744 FieldMember.prototype._get$3 = function($0, $1, $2) { |
| 5758 return this._get($0, $1, $2, false); | 5745 return this._get($0, $1, $2, false); |
| 5759 }; | 5746 }; |
| 5760 FieldMember.prototype._get$3$isDynamic = FieldMember.prototype._get; | 5747 FieldMember.prototype._get$3$isDynamic = FieldMember.prototype._get; |
| 5761 FieldMember.prototype._get$4 = FieldMember.prototype._get; | 5748 FieldMember.prototype._get$4 = FieldMember.prototype._get; |
| 5762 FieldMember.prototype._set$4 = function($0, $1, $2, $3) { | |
| 5763 return this._set($0, $1, $2, $3, false); | |
| 5764 }; | |
| 5765 FieldMember.prototype._set$4$isDynamic = FieldMember.prototype._set; | 5749 FieldMember.prototype._set$4$isDynamic = FieldMember.prototype._set; |
| 5766 FieldMember.prototype._set$5 = FieldMember.prototype._set; | 5750 FieldMember.prototype._set$5 = FieldMember.prototype._set; |
| 5767 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; | 5751 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; |
| 5768 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS yntax; | 5752 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS yntax; |
| 5769 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro pertySyntax; | 5753 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro pertySyntax; |
| 5770 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; | 5754 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; |
| 5771 // ********** Code for PropertyMember ************** | 5755 // ********** Code for PropertyMember ************** |
| 5772 $inherits(PropertyMember, Member); | 5756 $inherits(PropertyMember, Member); |
| 5773 function PropertyMember(name, declaringType) { | 5757 function PropertyMember(name, declaringType) { |
| 5774 Member.call(this, name, declaringType); | 5758 Member.call(this, name, declaringType); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5867 $globals.world.warning("setter methods should be void", this.setter.defini tion.returnType.span); | 5851 $globals.world.warning("setter methods should be void", this.setter.defini tion.returnType.span); |
| 5868 } | 5852 } |
| 5869 } | 5853 } |
| 5870 this.get$library()._addMember(this); | 5854 this.get$library()._addMember(this); |
| 5871 } | 5855 } |
| 5872 PropertyMember.prototype._get$3 = function($0, $1, $2) { | 5856 PropertyMember.prototype._get$3 = function($0, $1, $2) { |
| 5873 return this._get($0, $1, $2, false); | 5857 return this._get($0, $1, $2, false); |
| 5874 }; | 5858 }; |
| 5875 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get; | 5859 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get; |
| 5876 PropertyMember.prototype._get$4 = PropertyMember.prototype._get; | 5860 PropertyMember.prototype._get$4 = PropertyMember.prototype._get; |
| 5877 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { | |
| 5878 return this._set($0, $1, $2, $3, false); | |
| 5879 }; | |
| 5880 PropertyMember.prototype._set$4$isDynamic = PropertyMember.prototype._set; | 5861 PropertyMember.prototype._set$4$isDynamic = PropertyMember.prototype._set; |
| 5881 PropertyMember.prototype._set$5 = PropertyMember.prototype._set; | 5862 PropertyMember.prototype._set$5 = PropertyMember.prototype._set; |
| 5882 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide FieldSyntax; | 5863 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide FieldSyntax; |
| 5883 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov idePropertySyntax; | 5864 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov idePropertySyntax; |
| 5884 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; | 5865 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; |
| 5885 // ********** Code for ConcreteMember ************** | 5866 // ********** Code for ConcreteMember ************** |
| 5886 $inherits(ConcreteMember, Member); | 5867 $inherits(ConcreteMember, Member); |
| 5887 function ConcreteMember(name, declaringType, baseMember) { | 5868 function ConcreteMember(name, declaringType, baseMember) { |
| 5888 this.baseMember = baseMember; | 5869 this.baseMember = baseMember; |
| 5889 Member.call(this, name, declaringType); | 5870 Member.call(this, name, declaringType); |
| 5890 this.parameters = []; | 5871 this.parameters = []; |
| 5891 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type); | 5872 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type); |
| 5892 var $$list = this.baseMember.get$parameters(); | 5873 var $$list = this.baseMember.get$parameters(); |
| 5893 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5874 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5894 var p = $$list.$index($$i); | 5875 var p = $$list[$$i]; |
| 5895 var newType = p.get$type().resolveTypeParams$1(declaringType); | 5876 var newType = p.get$type().resolveTypeParams$1(declaringType); |
| 5896 if ($ne(newType, p.get$type())) { | 5877 if ($ne(newType, p.get$type())) { |
| 5897 this.parameters.add(p.copyWithNewType$2(this, newType)); | 5878 this.parameters.add(p.copyWithNewType$2(this, newType)); |
| 5898 } | 5879 } |
| 5899 else { | 5880 else { |
| 5900 this.parameters.add(p); | 5881 this.parameters.add(p); |
| 5901 } | 5882 } |
| 5902 } | 5883 } |
| 5903 } | 5884 } |
| 5904 ConcreteMember.prototype.get$returnType = function() { return this.returnType; } ; | 5885 ConcreteMember.prototype.get$returnType = function() { return this.returnType; } ; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6005 this.declaringType.genMethod(this); | 5986 this.declaringType.genMethod(this); |
| 6006 } | 5987 } |
| 6007 return new Value(this.get$inferredResult(), code, node.span); | 5988 return new Value(this.get$inferredResult(), code, node.span); |
| 6008 } | 5989 } |
| 6009 ConcreteMember.prototype._evalConstConstructor$2 = ConcreteMember.prototype._eva lConstConstructor; | 5990 ConcreteMember.prototype._evalConstConstructor$2 = ConcreteMember.prototype._eva lConstConstructor; |
| 6010 ConcreteMember.prototype._get$3 = function($0, $1, $2) { | 5991 ConcreteMember.prototype._get$3 = function($0, $1, $2) { |
| 6011 return this._get($0, $1, $2, false); | 5992 return this._get($0, $1, $2, false); |
| 6012 }; | 5993 }; |
| 6013 ConcreteMember.prototype._get$3$isDynamic = ConcreteMember.prototype._get; | 5994 ConcreteMember.prototype._get$3$isDynamic = ConcreteMember.prototype._get; |
| 6014 ConcreteMember.prototype._get$4 = ConcreteMember.prototype._get; | 5995 ConcreteMember.prototype._get$4 = ConcreteMember.prototype._get; |
| 6015 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) { | |
| 6016 return this._set($0, $1, $2, $3, false); | |
| 6017 }; | |
| 6018 ConcreteMember.prototype._set$4$isDynamic = ConcreteMember.prototype._set; | 5996 ConcreteMember.prototype._set$4$isDynamic = ConcreteMember.prototype._set; |
| 6019 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; | 5997 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; |
| 6020 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; | 5998 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; |
| 6021 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; | 5999 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; |
| 6022 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 6000 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6023 return this.invoke($0, $1, $2, $3, false); | 6001 return this.invoke($0, $1, $2, $3, false); |
| 6024 }; | 6002 }; |
| 6025 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; | 6003 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; |
| 6026 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; | 6004 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; |
| 6027 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide FieldSyntax; | 6005 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide FieldSyntax; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6111 return false; | 6089 return false; |
| 6112 } | 6090 } |
| 6113 } | 6091 } |
| 6114 MethodMember.prototype.canInvoke = function(context, args) { | 6092 MethodMember.prototype.canInvoke = function(context, args) { |
| 6115 var bareCount = args.get$bareCount(); | 6093 var bareCount = args.get$bareCount(); |
| 6116 if (bareCount > this.parameters.get$length()) return false; | 6094 if (bareCount > this.parameters.get$length()) return false; |
| 6117 if (bareCount == this.parameters.get$length()) { | 6095 if (bareCount == this.parameters.get$length()) { |
| 6118 if (bareCount != args.get$length()) return false; | 6096 if (bareCount != args.get$length()) return false; |
| 6119 } | 6097 } |
| 6120 else { | 6098 else { |
| 6121 if (!this.parameters.$index(bareCount).get$isOptional()) return false; | 6099 if (!this.parameters[bareCount].get$isOptional()) return false; |
| 6122 for (var i = bareCount; | 6100 for (var i = bareCount; |
| 6123 i < args.get$length(); i++) { | 6101 i < args.get$length(); i++) { |
| 6124 if (this.indexOfParameter(args.getName(i)) < (0)) { | 6102 if (this.indexOfParameter(args.getName(i)) < (0)) { |
| 6125 return false; | 6103 return false; |
| 6126 } | 6104 } |
| 6127 } | 6105 } |
| 6128 } | 6106 } |
| 6129 return true; | 6107 return true; |
| 6130 } | 6108 } |
| 6131 MethodMember.prototype.indexOfParameter = function(name) { | 6109 MethodMember.prototype.indexOfParameter = function(name) { |
| 6132 for (var i = (0); | 6110 for (var i = (0); |
| 6133 i < this.parameters.get$length(); i++) { | 6111 i < this.parameters.get$length(); i++) { |
| 6134 var p = this.parameters.$index(i); | 6112 var p = this.parameters[i]; |
| 6135 if (p.get$isOptional() && $eq(p.get$name(), name)) { | 6113 if (p.get$isOptional() && $eq(p.get$name(), name)) { |
| 6136 return i; | 6114 return i; |
| 6137 } | 6115 } |
| 6138 } | 6116 } |
| 6139 return (-1); | 6117 return (-1); |
| 6140 } | 6118 } |
| 6141 MethodMember.prototype.provideFieldSyntax = function() { | 6119 MethodMember.prototype.provideFieldSyntax = function() { |
| 6142 this._provideFieldSyntax = true; | 6120 this._provideFieldSyntax = true; |
| 6143 } | 6121 } |
| 6144 MethodMember.prototype.providePropertySyntax = function() { | 6122 MethodMember.prototype.providePropertySyntax = function() { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 6158 this._providePropertySyntax = true; | 6136 this._providePropertySyntax = true; |
| 6159 return new Value(this.get$functionType(), ("" + target.get$code() + ".get$" + this.get$jsname() + "()"), node.span); | 6137 return new Value(this.get$functionType(), ("" + target.get$code() + ".get$" + this.get$jsname() + "()"), node.span); |
| 6160 } | 6138 } |
| 6161 MethodMember.prototype.namesInHomePositions = function(args) { | 6139 MethodMember.prototype.namesInHomePositions = function(args) { |
| 6162 if (!args.get$hasNames()) return true; | 6140 if (!args.get$hasNames()) return true; |
| 6163 for (var i = args.get$bareCount(); | 6141 for (var i = args.get$bareCount(); |
| 6164 i < args.values.get$length(); i++) { | 6142 i < args.values.get$length(); i++) { |
| 6165 if (i >= this.parameters.get$length()) { | 6143 if (i >= this.parameters.get$length()) { |
| 6166 return false; | 6144 return false; |
| 6167 } | 6145 } |
| 6168 if (args.getName(i) != this.parameters.$index(i).get$name()) { | 6146 if (args.getName(i) != this.parameters[i].get$name()) { |
| 6169 return false; | 6147 return false; |
| 6170 } | 6148 } |
| 6171 } | 6149 } |
| 6172 return true; | 6150 return true; |
| 6173 } | 6151 } |
| 6174 MethodMember.prototype.namesInOrder = function(args) { | 6152 MethodMember.prototype.namesInOrder = function(args) { |
| 6175 if (!args.get$hasNames()) return true; | 6153 if (!args.get$hasNames()) return true; |
| 6176 var lastParameter = null; | 6154 var lastParameter = null; |
| 6177 for (var i = args.get$bareCount(); | 6155 for (var i = args.get$bareCount(); |
| 6178 i < this.parameters.get$length(); i++) { | 6156 i < this.parameters.get$length(); i++) { |
| 6179 var p = args.getIndexOfName(this.parameters.$index(i).get$name()); | 6157 var p = args.getIndexOfName(this.parameters[i].get$name()); |
| 6180 if (p >= (0) && args.values.$index(p).get$needsTemp()) { | 6158 if (p >= (0) && args.values[p].get$needsTemp()) { |
| 6181 if (lastParameter != null && lastParameter > p) { | 6159 if (lastParameter != null && lastParameter > p) { |
| 6182 return false; | 6160 return false; |
| 6183 } | 6161 } |
| 6184 lastParameter = p; | 6162 lastParameter = p; |
| 6185 } | 6163 } |
| 6186 } | 6164 } |
| 6187 return true; | 6165 return true; |
| 6188 } | 6166 } |
| 6189 MethodMember.prototype.needsArgumentConversion = function(args) { | 6167 MethodMember.prototype.needsArgumentConversion = function(args) { |
| 6190 var bareCount = args.get$bareCount(); | 6168 var bareCount = args.get$bareCount(); |
| 6191 for (var i = (0); | 6169 for (var i = (0); |
| 6192 i < bareCount; i++) { | 6170 i < bareCount; i++) { |
| 6193 var arg = args.values.$index(i); | 6171 var arg = args.values[i]; |
| 6194 if (arg.needsConversion$1(this.parameters.$index(i).get$type())) { | 6172 if (arg.needsConversion$1(this.parameters[i].get$type())) { |
| 6195 return true; | 6173 return true; |
| 6196 } | 6174 } |
| 6197 } | 6175 } |
| 6198 if (bareCount < this.parameters.get$length()) { | 6176 if (bareCount < this.parameters.get$length()) { |
| 6199 this.genParameterValues(); | 6177 this.genParameterValues(); |
| 6200 for (var i = bareCount; | 6178 for (var i = bareCount; |
| 6201 i < this.parameters.get$length(); i++) { | 6179 i < this.parameters.get$length(); i++) { |
| 6202 var arg = args.getValue(this.parameters.$index(i).get$name()); | 6180 var arg = args.getValue(this.parameters[i].get$name()); |
| 6203 if (arg != null && arg.needsConversion$1(this.parameters.$index(i).get$typ e())) { | 6181 if (arg != null && arg.needsConversion$1(this.parameters[i].get$type())) { |
| 6204 return true; | 6182 return true; |
| 6205 } | 6183 } |
| 6206 } | 6184 } |
| 6207 } | 6185 } |
| 6208 return false; | 6186 return false; |
| 6209 } | 6187 } |
| 6210 MethodMember._argCountMsg = function(actual, expected, atLeast) { | 6188 MethodMember._argCountMsg = function(actual, expected, atLeast) { |
| 6211 return "wrong number of positional arguments, expected " + ("" + (atLeast ? "a t least " : "") + expected + " but found " + actual); | 6189 return "wrong number of positional arguments, expected " + ("" + (atLeast ? "a t least " : "") + expected + " but found " + actual); |
| 6212 } | 6190 } |
| 6213 MethodMember.prototype._argError = function(context, node, target, args, msg, ar gIndex) { | 6191 MethodMember.prototype._argError = function(context, node, target, args, msg, ar gIndex) { |
| 6214 var span; | 6192 var span; |
| 6215 if ((args.nodes == null) || (argIndex >= args.nodes.get$length())) { | 6193 if ((args.nodes == null) || (argIndex >= args.nodes.get$length())) { |
| 6216 span = node.span; | 6194 span = node.span; |
| 6217 } | 6195 } |
| 6218 else { | 6196 else { |
| 6219 span = args.nodes.$index(argIndex).get$span(); | 6197 span = args.nodes[argIndex].get$span(); |
| 6220 } | 6198 } |
| 6221 if (this.isStatic || this.get$isConstructor()) { | 6199 if (this.isStatic || this.get$isConstructor()) { |
| 6222 $globals.world.error(msg, span); | 6200 $globals.world.error(msg, span); |
| 6223 } | 6201 } |
| 6224 else { | 6202 else { |
| 6225 $globals.world.warning(msg, span); | 6203 $globals.world.warning(msg, span); |
| 6226 } | 6204 } |
| 6227 return target.invokeNoSuchMethod(context, this.name, node, args); | 6205 return target.invokeNoSuchMethod(context, this.name, node, args); |
| 6228 } | 6206 } |
| 6229 MethodMember.prototype.genParameterValues = function() { | 6207 MethodMember.prototype.genParameterValues = function() { |
| 6230 var $$list = this.parameters; | 6208 var $$list = this.parameters; |
| 6231 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6209 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6232 var p = $$list.$index($$i); | 6210 var p = $$list[$$i]; |
| 6233 p.genValue$2(this, this.generator); | 6211 p.genValue$2(this, this.generator); |
| 6234 } | 6212 } |
| 6235 } | 6213 } |
| 6236 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic) { | 6214 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 6237 if (this.parameters == null) { | 6215 if (this.parameters == null) { |
| 6238 $globals.world.info(("surprised to need to resolve: " + this.declaringType.n ame + "." + this.name)); | 6216 $globals.world.info(("surprised to need to resolve: " + this.declaringType.n ame + "." + this.name)); |
| 6239 this.resolve(); | 6217 this.resolve(); |
| 6240 } | 6218 } |
| 6241 this.declaringType.genMethod(this); | 6219 this.declaringType.genMethod(this); |
| 6242 if (this.isStatic || this.isFactory) { | 6220 if (this.isStatic || this.isFactory) { |
| 6243 this.declaringType.markUsed(); | 6221 this.declaringType.markUsed(); |
| 6244 } | 6222 } |
| 6245 if (this.get$isNative() && this.returnType != null) this.returnType.markUsed() ; | 6223 if (this.get$isNative() && this.returnType != null) this.returnType.markUsed() ; |
| 6246 if (!this.namesInOrder(args)) { | 6224 if (!this.namesInOrder(args)) { |
| 6247 return context.findMembers(this.name).invokeOnVar(context, node, target, arg s); | 6225 return context.findMembers(this.name).invokeOnVar(context, node, target, arg s); |
| 6248 } | 6226 } |
| 6249 var argsCode = []; | 6227 var argsCode = []; |
| 6250 if (!target.get$isType() && (this.get$isConstructor() || target.get$isSuper()) ) { | 6228 if (!target.get$isType() && (this.get$isConstructor() || target.get$isSuper()) ) { |
| 6251 argsCode.add$1("this"); | 6229 argsCode.add$1("this"); |
| 6252 } | 6230 } |
| 6253 var bareCount = args.get$bareCount(); | 6231 var bareCount = args.get$bareCount(); |
| 6254 for (var i = (0); | 6232 for (var i = (0); |
| 6255 i < bareCount; i++) { | 6233 i < bareCount; i++) { |
| 6256 var arg = args.values.$index(i); | 6234 var arg = args.values[i]; |
| 6257 if (i >= this.parameters.get$length()) { | 6235 if (i >= this.parameters.get$length()) { |
| 6258 var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.get $length(), false); | 6236 var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.get $length(), false); |
| 6259 return this._argError(context, node, target, args, msg, i); | 6237 return this._argError(context, node, target, args, msg, i); |
| 6260 } | 6238 } |
| 6261 arg = arg.convertTo$3(context, this.parameters.$index(i).get$type(), isDynam ic); | 6239 arg = arg.convertTo$3(context, this.parameters[i].get$type(), isDynamic); |
| 6262 argsCode.add$1(arg.get$code()); | 6240 argsCode.add$1(arg.get$code()); |
| 6263 } | 6241 } |
| 6264 var namedArgsUsed = (0); | 6242 var namedArgsUsed = (0); |
| 6265 if (bareCount < this.parameters.get$length()) { | 6243 if (bareCount < this.parameters.get$length()) { |
| 6266 this.genParameterValues(); | 6244 this.genParameterValues(); |
| 6267 for (var i = bareCount; | 6245 for (var i = bareCount; |
| 6268 i < this.parameters.get$length(); i++) { | 6246 i < this.parameters.get$length(); i++) { |
| 6269 var arg = args.getValue(this.parameters.$index(i).get$name()); | 6247 var arg = args.getValue(this.parameters[i].get$name()); |
| 6270 if (arg == null) { | 6248 if (arg == null) { |
| 6271 arg = this.parameters.$index(i).get$value(); | 6249 arg = this.parameters[i].get$value(); |
| 6272 } | 6250 } |
| 6273 else { | 6251 else { |
| 6274 arg = arg.convertTo$3(context, this.parameters.$index(i).get$type(), isD ynamic); | 6252 arg = arg.convertTo$3(context, this.parameters[i].get$type(), isDynamic) ; |
| 6275 namedArgsUsed++; | 6253 namedArgsUsed++; |
| 6276 } | 6254 } |
| 6277 if (arg == null || !this.parameters.$index(i).get$isOptional()) { | 6255 if (arg == null || !this.parameters[i].get$isOptional()) { |
| 6278 var msg = MethodMember._argCountMsg(Math.min(i, args.get$length()), i + (1), true); | 6256 var msg = MethodMember._argCountMsg(Math.min(i, args.get$length()), i + (1), true); |
| 6279 return this._argError(context, node, target, args, msg, i); | 6257 return this._argError(context, node, target, args, msg, i); |
| 6280 } | 6258 } |
| 6281 else { | 6259 else { |
| 6282 argsCode.add$1(arg.get$code()); | 6260 argsCode.add$1(arg.get$code()); |
| 6283 } | 6261 } |
| 6284 } | 6262 } |
| 6285 Arguments.removeTrailingNulls(argsCode); | 6263 Arguments.removeTrailingNulls(argsCode); |
| 6286 } | 6264 } |
| 6287 if (namedArgsUsed < args.get$nameCount()) { | 6265 if (namedArgsUsed < args.get$nameCount()) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6423 return new Value(this.get$inferredResult(), ("" + target.get$code() + "." + th is.get$jsname() + "(" + argsString + ")"), node.span); | 6401 return new Value(this.get$inferredResult(), ("" + target.get$code() + "." + th is.get$jsname() + "(" + argsString + ")"), node.span); |
| 6424 } | 6402 } |
| 6425 MethodMember.prototype.resolve = function() { | 6403 MethodMember.prototype.resolve = function() { |
| 6426 this.isStatic = this.declaringType.get$isTop(); | 6404 this.isStatic = this.declaringType.get$isTop(); |
| 6427 this.isConst = false; | 6405 this.isConst = false; |
| 6428 this.isFactory = false; | 6406 this.isFactory = false; |
| 6429 this.isAbstract = !this.declaringType.get$isClass(); | 6407 this.isAbstract = !this.declaringType.get$isClass(); |
| 6430 if (this.definition.modifiers != null) { | 6408 if (this.definition.modifiers != null) { |
| 6431 var $$list = this.definition.modifiers; | 6409 var $$list = this.definition.modifiers; |
| 6432 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6410 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6433 var mod = $$list.$index($$i); | 6411 var mod = $$list[$$i]; |
| 6434 if ($eq(mod.get$kind(), (85))) { | 6412 if ($eq(mod.get$kind(), (85))) { |
| 6435 if (this.isStatic) { | 6413 if (this.isStatic) { |
| 6436 $globals.world.error("duplicate static modifier", mod.get$span()); | 6414 $globals.world.error("duplicate static modifier", mod.get$span()); |
| 6437 } | 6415 } |
| 6438 this.isStatic = true; | 6416 this.isStatic = true; |
| 6439 } | 6417 } |
| 6440 else if (this.get$isConstructor() && $eq(mod.get$kind(), (92))) { | 6418 else if (this.get$isConstructor() && $eq(mod.get$kind(), (92))) { |
| 6441 if (this.isConst) { | 6419 if (this.isConst) { |
| 6442 $globals.world.error("duplicate const modifier", mod.get$span()); | 6420 $globals.world.error("duplicate const modifier", mod.get$span()); |
| 6443 } | 6421 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6495 } | 6473 } |
| 6496 if (this.get$isConstructor() && !this.isFactory) { | 6474 if (this.get$isConstructor() && !this.isFactory) { |
| 6497 this.returnType = this.declaringType; | 6475 this.returnType = this.declaringType; |
| 6498 } | 6476 } |
| 6499 else { | 6477 else { |
| 6500 this.returnType = this.resolveType(this.definition.returnType, false, true); | 6478 this.returnType = this.resolveType(this.definition.returnType, false, true); |
| 6501 } | 6479 } |
| 6502 this.parameters = []; | 6480 this.parameters = []; |
| 6503 var $$list = this.definition.formals; | 6481 var $$list = this.definition.formals; |
| 6504 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6482 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6505 var formal = $$list.$index($$i); | 6483 var formal = $$list[$$i]; |
| 6506 var param = new Parameter(formal, this); | 6484 var param = new Parameter(formal, this); |
| 6507 param.resolve$0(); | 6485 param.resolve$0(); |
| 6508 this.parameters.add(param); | 6486 this.parameters.add(param); |
| 6509 } | 6487 } |
| 6510 if (!this.isLambda) { | 6488 if (!this.isLambda) { |
| 6511 this.get$library()._addMember(this); | 6489 this.get$library()._addMember(this); |
| 6512 } | 6490 } |
| 6513 } | 6491 } |
| 6514 MethodMember.prototype.resolveType = function(node, typeErrors, allowVoid) { | 6492 MethodMember.prototype.resolveType = function(node, typeErrors, allowVoid) { |
| 6515 var t = Element.prototype.resolveType.call(this, node, typeErrors); | 6493 var t = Element.prototype.resolveType.call(this, node, typeErrors); |
| 6516 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { | 6494 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { |
| 6517 $globals.world.error("using type parameter in static context.", node.span); | 6495 $globals.world.error("using type parameter in static context.", node.span); |
| 6518 } | 6496 } |
| 6519 if (!allowVoid && t.get$isVoid()) { | 6497 if (!allowVoid && t.get$isVoid()) { |
| 6520 $globals.world.error("\"void\" only allowed as return type", node.span); | 6498 $globals.world.error("\"void\" only allowed as return type", node.span); |
| 6521 } | 6499 } |
| 6522 return t; | 6500 return t; |
| 6523 } | 6501 } |
| 6524 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon stConstructor; | 6502 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon stConstructor; |
| 6525 MethodMember.prototype._get$3 = function($0, $1, $2) { | 6503 MethodMember.prototype._get$3 = function($0, $1, $2) { |
| 6526 return this._get($0, $1, $2, false); | 6504 return this._get($0, $1, $2, false); |
| 6527 }; | 6505 }; |
| 6528 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; | 6506 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; |
| 6529 MethodMember.prototype._get$4 = MethodMember.prototype._get; | 6507 MethodMember.prototype._get$4 = MethodMember.prototype._get; |
| 6530 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { | |
| 6531 return this._set($0, $1, $2, $3, false); | |
| 6532 }; | |
| 6533 MethodMember.prototype._set$4$isDynamic = MethodMember.prototype._set; | 6508 MethodMember.prototype._set$4$isDynamic = MethodMember.prototype._set; |
| 6534 MethodMember.prototype._set$5 = MethodMember.prototype._set; | 6509 MethodMember.prototype._set$5 = MethodMember.prototype._set; |
| 6535 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; | 6510 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; |
| 6536 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 6511 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6537 return this.invoke($0, $1, $2, $3, false); | 6512 return this.invoke($0, $1, $2, $3, false); |
| 6538 }; | 6513 }; |
| 6539 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; | 6514 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; |
| 6540 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; | 6515 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; |
| 6541 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; | 6516 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; |
| 6542 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel dSyntax; | 6517 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel dSyntax; |
| 6543 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP ropertySyntax; | 6518 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP ropertySyntax; |
| 6544 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; | 6519 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; |
| 6545 MethodMember.prototype.resolveType$2 = function($0, $1) { | 6520 MethodMember.prototype.resolveType$2 = function($0, $1) { |
| 6546 return this.resolveType($0, $1, false); | 6521 return this.resolveType($0, $1, false); |
| 6547 }; | 6522 }; |
| 6548 // ********** Code for MemberSet ************** | 6523 // ********** Code for MemberSet ************** |
| 6549 function MemberSet(member, isVar) { | 6524 function MemberSet(member, isVar) { |
| 6550 this.jsname = member.get$jsname(); | 6525 this.jsname = member.get$jsname(); |
| 6551 this.name = member.name; | 6526 this.name = member.name; |
| 6552 this.isVar = isVar; | 6527 this.isVar = isVar; |
| 6553 this.members = [member]; | 6528 this.members = [member]; |
| 6554 } | 6529 } |
| 6555 MemberSet.prototype.get$name = function() { return this.name; }; | 6530 MemberSet.prototype.get$name = function() { return this.name; }; |
| 6556 MemberSet.prototype.get$members = function() { return this.members; }; | 6531 MemberSet.prototype.get$members = function() { return this.members; }; |
| 6557 MemberSet.prototype.get$jsname = function() { return this.jsname; }; | 6532 MemberSet.prototype.get$jsname = function() { return this.jsname; }; |
| 6558 MemberSet.prototype.get$isVar = function() { return this.isVar; }; | 6533 MemberSet.prototype.get$isVar = function() { return this.isVar; }; |
| 6559 MemberSet.prototype.toString = function() { | 6534 MemberSet.prototype.toString = function() { |
| 6560 return ("" + this.name + ":" + this.members.get$length()); | 6535 return ("" + this.name + ":" + this.members.get$length()); |
| 6561 } | 6536 } |
| 6562 MemberSet.prototype.get$containsMethods = function() { | |
| 6563 return this.members.some((function (m) { | |
| 6564 return (m instanceof MethodMember); | |
| 6565 }) | |
| 6566 ); | |
| 6567 } | |
| 6568 MemberSet.prototype.add = function(member) { | 6537 MemberSet.prototype.add = function(member) { |
| 6569 return this.members.add(member); | 6538 return this.members.add(member); |
| 6570 } | 6539 } |
| 6571 MemberSet.prototype.get$isStatic = function() { | 6540 MemberSet.prototype.get$isStatic = function() { |
| 6572 return this.members.get$length() == (1) && this.members.$index((0)).get$isStat ic(); | 6541 return this.members.get$length() == (1) && this.members[(0)].get$isStatic(); |
| 6573 } | 6542 } |
| 6574 MemberSet.prototype.get$isOperator = function() { | 6543 MemberSet.prototype.get$isOperator = function() { |
| 6575 return this.members.$index((0)).get$isOperator(); | 6544 return this.members[(0)].get$isOperator(); |
| 6576 } | 6545 } |
| 6577 MemberSet.prototype.canInvoke = function(context, args) { | 6546 MemberSet.prototype.canInvoke = function(context, args) { |
| 6578 return this.members.some((function (m) { | 6547 return this.members.some((function (m) { |
| 6579 return m.canInvoke$2(context, args); | 6548 return m.canInvoke$2(context, args); |
| 6580 }) | 6549 }) |
| 6581 ); | 6550 ); |
| 6582 } | 6551 } |
| 6583 MemberSet.prototype._makeError = function(node, target, action) { | 6552 MemberSet.prototype._makeError = function(node, target, action) { |
| 6584 if (!target.get$type().get$isVar()) { | 6553 if (!target.get$type().get$isVar()) { |
| 6585 $globals.world.warning(("could not find applicable " + action + " for \"" + this.name + "\""), node.span); | 6554 $globals.world.warning(("could not find applicable " + action + " for \"" + this.name + "\""), node.span); |
| 6586 } | 6555 } |
| 6587 return new Value($globals.world.varType, ("" + target.get$code() + "." + this. jsname + "() /*no applicable " + action + "*/"), node.span); | 6556 return new Value($globals.world.varType, ("" + target.get$code() + "." + this. jsname + "() /*no applicable " + action + "*/"), node.span); |
| 6588 } | 6557 } |
| 6589 MemberSet.prototype.get$treatAsField = function() { | 6558 MemberSet.prototype.get$treatAsField = function() { |
| 6590 if (this._treatAsField == null) { | 6559 if (this._treatAsField == null) { |
| 6591 this._treatAsField = !this.isVar && (this.members.some((function (m) { | 6560 this._treatAsField = !this.isVar && (this.members.some((function (m) { |
| 6592 return m.get$requiresFieldSyntax(); | 6561 return m.get$requiresFieldSyntax(); |
| 6593 }) | 6562 }) |
| 6594 ) || this.members.every((function (m) { | 6563 ) || this.members.every((function (m) { |
| 6595 return !m.get$requiresPropertySyntax(); | 6564 return !m.get$requiresPropertySyntax(); |
| 6596 }) | 6565 }) |
| 6597 )); | 6566 )); |
| 6598 var $$list = this.members; | 6567 var $$list = this.members; |
| 6599 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6568 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6600 var member = $$list.$index($$i); | 6569 var member = $$list[$$i]; |
| 6601 if (this._treatAsField) { | 6570 if (this._treatAsField) { |
| 6602 member.provideFieldSyntax$0(); | 6571 member.provideFieldSyntax$0(); |
| 6603 } | 6572 } |
| 6604 else { | 6573 else { |
| 6605 member.providePropertySyntax$0(); | 6574 member.providePropertySyntax$0(); |
| 6606 } | 6575 } |
| 6607 } | 6576 } |
| 6608 } | 6577 } |
| 6609 return this._treatAsField; | 6578 return this._treatAsField; |
| 6610 } | 6579 } |
| 6611 MemberSet.prototype._get = function(context, node, target, isDynamic) { | 6580 MemberSet.prototype._get = function(context, node, target, isDynamic) { |
| 6612 var returnValue; | 6581 var returnValue; |
| 6582 if (this.members.get$length() == (1) && !this.isVar) { | |
| 6583 return this.members[(0)]._get$4(context, node, target, isDynamic); | |
| 6584 } | |
| 6613 var targets = this.members.filter$1((function (m) { | 6585 var targets = this.members.filter$1((function (m) { |
| 6614 return m.get$canGet(); | 6586 return m.get$canGet(); |
| 6615 }) | 6587 }) |
| 6616 ); | 6588 ); |
| 6617 if (this.isVar) { | 6589 if (this.isVar) { |
| 6618 targets.forEach$1((function (m) { | 6590 targets.forEach$1((function (m) { |
| 6619 return m._get$3$isDynamic(context, node, target, true); | 6591 return m._get$3$isDynamic(context, node, target, true); |
| 6620 }) | 6592 }) |
| 6621 ); | 6593 ); |
| 6622 returnValue = new Value(this._foldTypes(targets), null, node.span); | 6594 returnValue = new Value(this._foldTypes(targets), null, node.span); |
| 6623 } | 6595 } |
| 6624 else { | 6596 else { |
| 6625 if (this.members.get$length() == (1)) { | 6597 if (this.members.get$length() == (1)) { |
| 6626 return this.members.$index((0))._get$4(context, node, target, isDynamic); | 6598 return this.members[(0)]._get$4(context, node, target, isDynamic); |
| 6627 } | 6599 } |
| 6628 else if ($eq(targets.get$length(), (1))) { | 6600 else if ($eq(targets.get$length(), (1))) { |
| 6629 return targets.$index((0))._get$4(context, node, target, isDynamic); | 6601 return targets.$index((0))._get$4(context, node, target, isDynamic); |
| 6630 } | 6602 } |
| 6631 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6603 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6632 var member = $$i.next$0(); | 6604 var member = $$i.next$0(); |
| 6633 var value = member._get$3$isDynamic(context, node, target, true); | 6605 var value = member._get$3$isDynamic(context, node, target, true); |
| 6634 returnValue = this._tryUnion(returnValue, value, node); | 6606 returnValue = this._tryUnion(returnValue, value, node); |
| 6635 } | 6607 } |
| 6636 if (returnValue == null) { | 6608 if (returnValue == null) { |
| 6637 return this._makeError(node, target, "getter"); | 6609 return this._makeError(node, target, "getter"); |
| 6638 } | 6610 } |
| 6639 } | 6611 } |
| 6640 if (returnValue.get$code() == null) { | 6612 if (returnValue.get$code() == null) { |
| 6641 if (this.get$treatAsField()) { | 6613 if (this.get$treatAsField()) { |
| 6642 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t his.jsname), node.span); | 6614 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t his.jsname), node.span); |
| 6643 } | 6615 } |
| 6644 else { | 6616 else { |
| 6645 return new Value(returnValue.get$type(), ("" + target.get$code() + ".get$" + this.jsname + "()"), node.span); | 6617 return new Value(returnValue.get$type(), ("" + target.get$code() + ".get$" + this.jsname + "()"), node.span); |
| 6646 } | 6618 } |
| 6647 } | 6619 } |
| 6648 return returnValue; | 6620 return returnValue; |
| 6649 } | 6621 } |
| 6650 MemberSet.prototype._set = function(context, node, target, value, isDynamic) { | 6622 MemberSet.prototype._set = function(context, node, target, value, isDynamic) { |
| 6623 if (this.members.get$length() == (1) && !this.isVar) { | |
| 6624 return this.members[(0)]._set$5(context, node, target, value, isDynamic); | |
| 6625 } | |
| 6651 var returnValue; | 6626 var returnValue; |
| 6652 var targets = this.members.filter$1((function (m) { | 6627 var targets = this.members.filter$1((function (m) { |
| 6653 return m.get$canSet(); | 6628 return m.get$canSet(); |
| 6654 }) | 6629 }) |
| 6655 ); | 6630 ); |
| 6656 if (this.isVar) { | 6631 if (this.isVar) { |
| 6657 targets.forEach$1((function (m) { | 6632 targets.forEach$1((function (m) { |
| 6658 return m._set$4$isDynamic(context, node, target, value, true); | 6633 return m._set$4$isDynamic(context, node, target, value, true); |
| 6659 }) | 6634 }) |
| 6660 ); | 6635 ); |
| 6661 returnValue = new Value(this._foldTypes(targets), null, node.span); | 6636 returnValue = new Value(this._foldTypes(targets), null, node.span); |
| 6662 } | 6637 } |
| 6663 else { | 6638 else { |
| 6664 if (this.members.get$length() == (1)) { | 6639 if (this.members.get$length() == (1)) { |
| 6665 return this.members.$index((0))._set$5(context, node, target, value, isDyn amic); | 6640 return this.members[(0)]._set$5(context, node, target, value, isDynamic); |
| 6666 } | 6641 } |
| 6667 else if ($eq(targets.get$length(), (1))) { | 6642 else if ($eq(targets.get$length(), (1))) { |
| 6668 return targets.$index((0))._set$5(context, node, target, value, isDynamic) ; | 6643 return targets.$index((0))._set$5(context, node, target, value, isDynamic) ; |
| 6669 } | 6644 } |
| 6670 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6645 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6671 var member = $$i.next$0(); | 6646 var member = $$i.next$0(); |
| 6672 var res = member._set$4$isDynamic(context, node, target, value, true); | 6647 var res = member._set$4$isDynamic(context, node, target, value, true); |
| 6673 returnValue = this._tryUnion(returnValue, res, node); | 6648 returnValue = this._tryUnion(returnValue, res, node); |
| 6674 } | 6649 } |
| 6675 if (returnValue == null) { | 6650 if (returnValue == null) { |
| 6676 return this._makeError(node, target, "setter"); | 6651 return this._makeError(node, target, "setter"); |
| 6677 } | 6652 } |
| 6678 } | 6653 } |
| 6679 if (returnValue.get$code() == null) { | 6654 if (returnValue.get$code() == null) { |
| 6680 if (this.get$treatAsField()) { | 6655 if (this.get$treatAsField()) { |
| 6681 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t his.jsname + " = " + value.get$code()), node.span); | 6656 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t his.jsname + " = " + value.get$code()), node.span); |
| 6682 } | 6657 } |
| 6683 else { | 6658 else { |
| 6684 return new Value(returnValue.get$type(), ("" + target.get$code() + ".set$" + this.jsname + "(" + value.get$code() + ")"), node.span); | 6659 return new Value(returnValue.get$type(), ("" + target.get$code() + ".set$" + this.jsname + "(" + value.get$code() + ")"), node.span); |
| 6685 } | 6660 } |
| 6686 } | 6661 } |
| 6687 return returnValue; | 6662 return returnValue; |
| 6688 } | 6663 } |
| 6689 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { | 6664 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 6690 if (this.isVar && !this.get$isOperator()) { | 6665 if (this.isVar && !this.get$isOperator()) { |
| 6691 return this.invokeOnVar(context, node, target, args); | 6666 return this.invokeOnVar(context, node, target, args); |
| 6692 } | 6667 } |
| 6693 if (this.members.get$length() == (1)) { | 6668 if (this.members.get$length() == (1) && !this.isVar) { |
| 6694 return this.members.$index((0)).invoke$5(context, node, target, args, isDyna mic); | 6669 return this.members[(0)].invoke$5(context, node, target, args, isDynamic); |
| 6695 } | 6670 } |
| 6696 var targets = this.members.filter$1((function (m) { | 6671 var targets = this.members.filter$1((function (m) { |
| 6697 return m.canInvoke$2(context, args); | 6672 return m.canInvoke$2(context, args); |
| 6698 }) | 6673 }) |
| 6699 ); | 6674 ); |
| 6700 if ($eq(targets.get$length(), (1))) { | 6675 if ($eq(targets.get$length(), (1))) { |
| 6701 return targets.$index((0)).invoke$5(context, node, target, args, isDynamic); | 6676 return targets.$index((0)).invoke$5(context, node, target, args, isDynamic); |
| 6702 } | 6677 } |
| 6703 var returnValue = null; | 6678 var returnValue = null; |
| 6704 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6679 if (targets.get$length() < (1000)) { |
| 6705 var member = $$i.next$0(); | 6680 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6706 var res = member.invoke$4$isDynamic(context, node, target, args, true); | 6681 var member = $$i.next$0(); |
| 6707 returnValue = this._tryUnion(returnValue, res, node); | 6682 var res = member.invoke$4$isDynamic(context, node, target, args, true); |
| 6683 returnValue = this._tryUnion(returnValue, res, node); | |
| 6684 } | |
| 6685 if (returnValue == null) { | |
| 6686 return this._makeError(node, target, "method"); | |
| 6687 } | |
| 6708 } | 6688 } |
| 6709 if (returnValue == null) { | 6689 else { |
| 6710 return this._makeError(node, target, "method"); | 6690 returnValue = new Value($globals.world.varType, null, node.span); |
| 6711 } | 6691 } |
| 6712 if (returnValue.get$code() == null) { | 6692 if (returnValue.get$code() == null) { |
| 6713 if (this.name == ":call") { | 6693 if (this.name == ":call") { |
| 6714 return target._varCall(context, node, args); | 6694 return target._varCall(context, node, args); |
| 6715 } | 6695 } |
| 6716 else if (this.get$isOperator()) { | 6696 else if (this.get$isOperator()) { |
| 6717 return this.invokeSpecial(target, args, returnValue.get$type()); | 6697 return this.invokeSpecial(target, args, returnValue.get$type()); |
| 6718 } | 6698 } |
| 6719 else { | 6699 else { |
| 6720 return this.invokeOnVar(context, node, target, args); | 6700 return this.invokeOnVar(context, node, target, args); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6777 return reduce(map(targets, (function (t) { | 6757 return reduce(map(targets, (function (t) { |
| 6778 return t.get$returnType(); | 6758 return t.get$returnType(); |
| 6779 }) | 6759 }) |
| 6780 ), Type.union, $globals.world.varType); | 6760 ), Type.union, $globals.world.varType); |
| 6781 } | 6761 } |
| 6782 MemberSet.prototype._get$3 = function($0, $1, $2) { | 6762 MemberSet.prototype._get$3 = function($0, $1, $2) { |
| 6783 return this._get($0, $1, $2, false); | 6763 return this._get($0, $1, $2, false); |
| 6784 }; | 6764 }; |
| 6785 MemberSet.prototype._get$3$isDynamic = MemberSet.prototype._get; | 6765 MemberSet.prototype._get$3$isDynamic = MemberSet.prototype._get; |
| 6786 MemberSet.prototype._get$4 = MemberSet.prototype._get; | 6766 MemberSet.prototype._get$4 = MemberSet.prototype._get; |
| 6787 MemberSet.prototype._set$4 = function($0, $1, $2, $3) { | |
| 6788 return this._set($0, $1, $2, $3, false); | |
| 6789 }; | |
| 6790 MemberSet.prototype._set$4$isDynamic = MemberSet.prototype._set; | 6767 MemberSet.prototype._set$4$isDynamic = MemberSet.prototype._set; |
| 6791 MemberSet.prototype._set$5 = MemberSet.prototype._set; | 6768 MemberSet.prototype._set$5 = MemberSet.prototype._set; |
| 6792 MemberSet.prototype.add$1 = MemberSet.prototype.add; | 6769 MemberSet.prototype.add$1 = MemberSet.prototype.add; |
| 6793 MemberSet.prototype.canInvoke$2 = MemberSet.prototype.canInvoke; | 6770 MemberSet.prototype.canInvoke$2 = MemberSet.prototype.canInvoke; |
| 6794 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { | 6771 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6795 return this.invoke($0, $1, $2, $3, false); | 6772 return this.invoke($0, $1, $2, $3, false); |
| 6796 }; | 6773 }; |
| 6797 MemberSet.prototype.invoke$4$isDynamic = MemberSet.prototype.invoke; | 6774 MemberSet.prototype.invoke$4$isDynamic = MemberSet.prototype.invoke; |
| 6798 MemberSet.prototype.invoke$5 = MemberSet.prototype.invoke; | 6775 MemberSet.prototype.invoke$5 = MemberSet.prototype.invoke; |
| 6799 MemberSet.prototype.toString$0 = MemberSet.prototype.toString; | 6776 MemberSet.prototype.toString$0 = MemberSet.prototype.toString; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 6811 } | 6788 } |
| 6812 FactoryMap.prototype.addFactory = function(typeName, name, member) { | 6789 FactoryMap.prototype.addFactory = function(typeName, name, member) { |
| 6813 this.getFactoriesFor(typeName).$setindex(name, member); | 6790 this.getFactoriesFor(typeName).$setindex(name, member); |
| 6814 } | 6791 } |
| 6815 FactoryMap.prototype.getFactory = function(typeName, name) { | 6792 FactoryMap.prototype.getFactory = function(typeName, name) { |
| 6816 return this.getFactoriesFor(typeName).$index(name); | 6793 return this.getFactoriesFor(typeName).$index(name); |
| 6817 } | 6794 } |
| 6818 FactoryMap.prototype.forEach = function(f) { | 6795 FactoryMap.prototype.forEach = function(f) { |
| 6819 this.factories.forEach((function (_, constructors) { | 6796 this.factories.forEach((function (_, constructors) { |
| 6820 constructors.forEach((function (_, member) { | 6797 constructors.forEach((function (_, member) { |
| 6821 f(member); | 6798 f.call$1(member); |
| 6822 }) | 6799 }) |
| 6823 ); | 6800 ); |
| 6824 }) | 6801 }) |
| 6825 ); | 6802 ); |
| 6826 } | 6803 } |
| 6827 FactoryMap.prototype.forEach$1 = function($0) { | 6804 FactoryMap.prototype.forEach$1 = function($0) { |
| 6828 return this.forEach(to$call$1($0)); | 6805 return this.forEach(to$call$1($0)); |
| 6829 }; | 6806 }; |
| 6830 FactoryMap.prototype.getFactory$2 = FactoryMap.prototype.getFactory; | 6807 FactoryMap.prototype.getFactory$2 = FactoryMap.prototype.getFactory; |
| 6831 // ********** Code for Token ************** | 6808 // ********** Code for Token ************** |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6907 } | 6884 } |
| 6908 SourceFile.prototype.getLine = function(position) { | 6885 SourceFile.prototype.getLine = function(position) { |
| 6909 var starts = this.get$lineStarts(); | 6886 var starts = this.get$lineStarts(); |
| 6910 for (var i = (0); | 6887 for (var i = (0); |
| 6911 i < starts.get$length(); i++) { | 6888 i < starts.get$length(); i++) { |
| 6912 if (starts.$index(i) > position) return i - (1); | 6889 if (starts.$index(i) > position) return i - (1); |
| 6913 } | 6890 } |
| 6914 $globals.world.internalError("bad position"); | 6891 $globals.world.internalError("bad position"); |
| 6915 } | 6892 } |
| 6916 SourceFile.prototype.getColumn = function(line, position) { | 6893 SourceFile.prototype.getColumn = function(line, position) { |
| 6917 return position - this.get$lineStarts().$index(line); | 6894 return position - this.get$lineStarts()[line]; |
| 6918 } | 6895 } |
| 6919 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT ext) { | 6896 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT ext) { |
| 6920 var line = this.getLine(start); | 6897 var line = this.getLine(start); |
| 6921 var column = this.getColumn(line, start); | 6898 var column = this.getColumn(line, start); |
| 6922 var buf = new StringBufferImpl(("" + this.filename + ":" + ($add(line, (1))) + ":" + ($add(column, (1))) + ": " + message)); | 6899 var buf = new StringBufferImpl(("" + this.filename + ":" + ($add(line, (1))) + ":" + ($add(column, (1))) + ": " + message)); |
| 6923 if (includeText) { | 6900 if (includeText) { |
| 6924 buf.add$1("\n"); | 6901 buf.add$1("\n"); |
| 6925 var textLine; | 6902 var textLine; |
| 6926 if (($add(line, (2))) < this._lineStarts.get$length()) { | 6903 if (($add(line, (2))) < this._lineStarts.get$length()) { |
| 6927 textLine = this.get$text().substring(this._lineStarts.$index(line), this._ lineStarts.$index($add(line, (1)))); | 6904 textLine = this.get$text().substring(this._lineStarts[line], this._lineSta rts[$add(line, (1))]); |
| 6928 } | 6905 } |
| 6929 else { | 6906 else { |
| 6930 textLine = this.get$text().substring(this._lineStarts.$index(line)) + "\n" ; | 6907 textLine = this.get$text().substring(this._lineStarts[line]) + "\n"; |
| 6931 } | 6908 } |
| 6932 var toColumn = Math.min($add(column, (end - start)), textLine.get$length()); | 6909 var toColumn = Math.min($add(column, (end - start)), textLine.get$length()); |
| 6933 if ($globals.options.useColors) { | 6910 if ($globals.options.useColors) { |
| 6934 buf.add$1(textLine.substring$2((0), column)); | 6911 buf.add$1(textLine.substring$2((0), column)); |
| 6935 buf.add$1($globals._RED_COLOR); | 6912 buf.add$1($globals._RED_COLOR); |
| 6936 buf.add$1(textLine.substring$2(column, toColumn)); | 6913 buf.add$1(textLine.substring$2(column, toColumn)); |
| 6937 buf.add$1($globals._NO_COLOR); | 6914 buf.add$1($globals._NO_COLOR); |
| 6938 buf.add$1(textLine.substring$1(toColumn)); | 6915 buf.add$1(textLine.substring$1(toColumn)); |
| 6939 } | 6916 } |
| 6940 else { | 6917 else { |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8495 case (115): | 8472 case (115): |
| 8496 | 8473 |
| 8497 return "keyword 'void'"; | 8474 return "keyword 'void'"; |
| 8498 | 8475 |
| 8499 case (116): | 8476 case (116): |
| 8500 | 8477 |
| 8501 return "keyword 'while'"; | 8478 return "keyword 'while'"; |
| 8502 | 8479 |
| 8503 default: | 8480 default: |
| 8504 | 8481 |
| 8505 return "TokenKind(" + kind.toString() + ")"; | 8482 return "TokenKind(" + kind.toString$0() + ")"; |
| 8506 | 8483 |
| 8507 } | 8484 } |
| 8508 } | 8485 } |
| 8509 TokenKind.isIdentifier = function(kind) { | 8486 TokenKind.isIdentifier = function(kind) { |
| 8510 return kind >= (70) && kind < (87); | 8487 return kind >= (70) && kind < (87); |
| 8511 } | 8488 } |
| 8512 TokenKind.infixPrecedence = function(kind) { | 8489 TokenKind.infixPrecedence = function(kind) { |
| 8513 switch (kind) { | 8490 switch (kind) { |
| 8514 case (20): | 8491 case (20): |
| 8515 | 8492 |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9904 if (this._inhibitLambda) return false; | 9881 if (this._inhibitLambda) return false; |
| 9905 var after = this._peekAfterCloseParen(); | 9882 var after = this._peekAfterCloseParen(); |
| 9906 return after.kind == (9) || after.kind == (6); | 9883 return after.kind == (9) || after.kind == (6); |
| 9907 } | 9884 } |
| 9908 Parser.prototype._eatLeftParen = function() { | 9885 Parser.prototype._eatLeftParen = function() { |
| 9909 this._eat((2)); | 9886 this._eat((2)); |
| 9910 this._afterParensIndex++; | 9887 this._afterParensIndex++; |
| 9911 } | 9888 } |
| 9912 Parser.prototype._peekAfterCloseParen = function() { | 9889 Parser.prototype._peekAfterCloseParen = function() { |
| 9913 if (this._afterParensIndex < this._afterParens.get$length()) { | 9890 if (this._afterParensIndex < this._afterParens.get$length()) { |
| 9914 return this._afterParens.$index(this._afterParensIndex); | 9891 return this._afterParens[this._afterParensIndex]; |
| 9915 } | 9892 } |
| 9916 this._afterParensIndex = (0); | 9893 this._afterParensIndex = (0); |
| 9917 this._afterParens.clear(); | 9894 this._afterParens.clear(); |
| 9918 var tokens = [this._lang_next()]; | 9895 var tokens = [this._lang_next()]; |
| 9919 this._lookaheadAfterParens(tokens); | 9896 this._lookaheadAfterParens(tokens); |
| 9920 var after = this._peekToken; | 9897 var after = this._peekToken; |
| 9921 tokens.add$1(after); | 9898 tokens.add$1(after); |
| 9922 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); | 9899 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); |
| 9923 this._lang_next(); | 9900 this._lang_next(); |
| 9924 return after; | 9901 return after; |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10375 } | 10352 } |
| 10376 IncompleteSourceException.prototype.toString$0 = IncompleteSourceException.proto type.toString; | 10353 IncompleteSourceException.prototype.toString$0 = IncompleteSourceException.proto type.toString; |
| 10377 // ********** Code for DivertedTokenSource ************** | 10354 // ********** Code for DivertedTokenSource ************** |
| 10378 function DivertedTokenSource(tokens, parser, previousTokenizer) { | 10355 function DivertedTokenSource(tokens, parser, previousTokenizer) { |
| 10379 this.parser = parser; | 10356 this.parser = parser; |
| 10380 this._lang_pos = (0); | 10357 this._lang_pos = (0); |
| 10381 this.tokens = tokens; | 10358 this.tokens = tokens; |
| 10382 this.previousTokenizer = previousTokenizer; | 10359 this.previousTokenizer = previousTokenizer; |
| 10383 } | 10360 } |
| 10384 DivertedTokenSource.prototype.next = function() { | 10361 DivertedTokenSource.prototype.next = function() { |
| 10385 var token = this.tokens.$index(this._lang_pos); | 10362 var token = this.tokens[this._lang_pos]; |
| 10386 ++this._lang_pos; | 10363 ++this._lang_pos; |
| 10387 if (this._lang_pos == this.tokens.get$length()) { | 10364 if (this._lang_pos == this.tokens.get$length()) { |
| 10388 this.parser.tokenizer = this.previousTokenizer; | 10365 this.parser.tokenizer = this.previousTokenizer; |
| 10389 } | 10366 } |
| 10390 return token; | 10367 return token; |
| 10391 } | 10368 } |
| 10392 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next; | 10369 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next; |
| 10393 // ********** Code for Node ************** | 10370 // ********** Code for Node ************** |
| 10394 function Node(span) { | 10371 function Node(span) { |
| 10395 this.span = span; | 10372 this.span = span; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10495 this.type = type; | 10472 this.type = type; |
| 10496 this.names = names; | 10473 this.names = names; |
| 10497 this.values = values; | 10474 this.values = values; |
| 10498 Definition.call(this, span); | 10475 Definition.call(this, span); |
| 10499 } | 10476 } |
| 10500 VariableDefinition.prototype.get$type = function() { return this.type; }; | 10477 VariableDefinition.prototype.get$type = function() { return this.type; }; |
| 10501 VariableDefinition.prototype.set$type = function(value) { return this.type = val ue; }; | 10478 VariableDefinition.prototype.set$type = function(value) { return this.type = val ue; }; |
| 10502 VariableDefinition.prototype.get$names = function() { return this.names; }; | 10479 VariableDefinition.prototype.get$names = function() { return this.names; }; |
| 10503 VariableDefinition.prototype.set$names = function(value) { return this.names = v alue; }; | 10480 VariableDefinition.prototype.set$names = function(value) { return this.names = v alue; }; |
| 10504 VariableDefinition.prototype.visit = function(visitor) { | 10481 VariableDefinition.prototype.visit = function(visitor) { |
| 10505 return visitor.visitVariableDefinition(this); | 10482 return visitor.visitVariableDefinition$1(this); |
| 10506 } | 10483 } |
| 10507 VariableDefinition.prototype.visit$1 = VariableDefinition.prototype.visit; | 10484 VariableDefinition.prototype.visit$1 = VariableDefinition.prototype.visit; |
| 10508 // ********** Code for FunctionDefinition ************** | 10485 // ********** Code for FunctionDefinition ************** |
| 10509 $inherits(FunctionDefinition, Definition); | 10486 $inherits(FunctionDefinition, Definition); |
| 10510 function FunctionDefinition(modifiers, returnType, name, formals, initializers, nativeBody, body, span) { | 10487 function FunctionDefinition(modifiers, returnType, name, formals, initializers, nativeBody, body, span) { |
| 10511 this.modifiers = modifiers; | 10488 this.modifiers = modifiers; |
| 10512 this.name = name; | 10489 this.name = name; |
| 10513 this.initializers = initializers; | 10490 this.initializers = initializers; |
| 10514 this.body = body; | 10491 this.body = body; |
| 10515 this.returnType = returnType; | 10492 this.returnType = returnType; |
| 10516 this.formals = formals; | 10493 this.formals = formals; |
| 10517 this.nativeBody = nativeBody; | 10494 this.nativeBody = nativeBody; |
| 10518 Definition.call(this, span); | 10495 Definition.call(this, span); |
| 10519 } | 10496 } |
| 10520 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp e; }; | 10497 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp e; }; |
| 10521 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu rnType = value; }; | 10498 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu rnType = value; }; |
| 10522 FunctionDefinition.prototype.get$name = function() { return this.name; }; | 10499 FunctionDefinition.prototype.get$name = function() { return this.name; }; |
| 10523 FunctionDefinition.prototype.set$name = function(value) { return this.name = val ue; }; | 10500 FunctionDefinition.prototype.set$name = function(value) { return this.name = val ue; }; |
| 10524 FunctionDefinition.prototype.get$initializers = function() { return this.initial izers; }; | 10501 FunctionDefinition.prototype.get$initializers = function() { return this.initial izers; }; |
| 10525 FunctionDefinition.prototype.set$initializers = function(value) { return this.in itializers = value; }; | 10502 FunctionDefinition.prototype.set$initializers = function(value) { return this.in itializers = value; }; |
| 10526 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod y; }; | 10503 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod y; }; |
| 10527 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati veBody = value; }; | 10504 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati veBody = value; }; |
| 10528 FunctionDefinition.prototype.get$body = function() { return this.body; }; | 10505 FunctionDefinition.prototype.get$body = function() { return this.body; }; |
| 10529 FunctionDefinition.prototype.set$body = function(value) { return this.body = val ue; }; | 10506 FunctionDefinition.prototype.set$body = function(value) { return this.body = val ue; }; |
| 10530 FunctionDefinition.prototype.visit = function(visitor) { | 10507 FunctionDefinition.prototype.visit = function(visitor) { |
| 10531 return visitor.visitFunctionDefinition(this); | 10508 return visitor.visitFunctionDefinition$1(this); |
| 10532 } | 10509 } |
| 10533 FunctionDefinition.prototype.visit$1 = FunctionDefinition.prototype.visit; | 10510 FunctionDefinition.prototype.visit$1 = FunctionDefinition.prototype.visit; |
| 10534 // ********** Code for ReturnStatement ************** | 10511 // ********** Code for ReturnStatement ************** |
| 10535 $inherits(ReturnStatement, Statement); | 10512 $inherits(ReturnStatement, Statement); |
| 10536 function ReturnStatement(value, span) { | 10513 function ReturnStatement(value, span) { |
| 10537 this.value = value; | 10514 this.value = value; |
| 10538 Statement.call(this, span); | 10515 Statement.call(this, span); |
| 10539 } | 10516 } |
| 10540 ReturnStatement.prototype.get$value = function() { return this.value; }; | 10517 ReturnStatement.prototype.get$value = function() { return this.value; }; |
| 10541 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; }; | 10518 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; }; |
| 10542 ReturnStatement.prototype.visit = function(visitor) { | 10519 ReturnStatement.prototype.visit = function(visitor) { |
| 10543 return visitor.visitReturnStatement(this); | 10520 return visitor.visitReturnStatement$1(this); |
| 10544 } | 10521 } |
| 10545 ReturnStatement.prototype.visit$1 = ReturnStatement.prototype.visit; | 10522 ReturnStatement.prototype.visit$1 = ReturnStatement.prototype.visit; |
| 10546 // ********** Code for ThrowStatement ************** | 10523 // ********** Code for ThrowStatement ************** |
| 10547 $inherits(ThrowStatement, Statement); | 10524 $inherits(ThrowStatement, Statement); |
| 10548 function ThrowStatement(value, span) { | 10525 function ThrowStatement(value, span) { |
| 10549 this.value = value; | 10526 this.value = value; |
| 10550 Statement.call(this, span); | 10527 Statement.call(this, span); |
| 10551 } | 10528 } |
| 10552 ThrowStatement.prototype.get$value = function() { return this.value; }; | 10529 ThrowStatement.prototype.get$value = function() { return this.value; }; |
| 10553 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; }; | 10530 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; }; |
| 10554 ThrowStatement.prototype.visit = function(visitor) { | 10531 ThrowStatement.prototype.visit = function(visitor) { |
| 10555 return visitor.visitThrowStatement(this); | 10532 return visitor.visitThrowStatement$1(this); |
| 10556 } | 10533 } |
| 10557 ThrowStatement.prototype.visit$1 = ThrowStatement.prototype.visit; | 10534 ThrowStatement.prototype.visit$1 = ThrowStatement.prototype.visit; |
| 10558 // ********** Code for AssertStatement ************** | 10535 // ********** Code for AssertStatement ************** |
| 10559 $inherits(AssertStatement, Statement); | 10536 $inherits(AssertStatement, Statement); |
| 10560 function AssertStatement(test, span) { | 10537 function AssertStatement(test, span) { |
| 10561 this.test = test; | 10538 this.test = test; |
| 10562 Statement.call(this, span); | 10539 Statement.call(this, span); |
| 10563 } | 10540 } |
| 10564 AssertStatement.prototype.visit = function(visitor) { | 10541 AssertStatement.prototype.visit = function(visitor) { |
| 10565 return visitor.visitAssertStatement(this); | 10542 return visitor.visitAssertStatement$1(this); |
| 10566 } | 10543 } |
| 10567 AssertStatement.prototype.visit$1 = AssertStatement.prototype.visit; | 10544 AssertStatement.prototype.visit$1 = AssertStatement.prototype.visit; |
| 10568 // ********** Code for BreakStatement ************** | 10545 // ********** Code for BreakStatement ************** |
| 10569 $inherits(BreakStatement, Statement); | 10546 $inherits(BreakStatement, Statement); |
| 10570 function BreakStatement(label, span) { | 10547 function BreakStatement(label, span) { |
| 10571 this.label = label; | 10548 this.label = label; |
| 10572 Statement.call(this, span); | 10549 Statement.call(this, span); |
| 10573 } | 10550 } |
| 10574 BreakStatement.prototype.get$label = function() { return this.label; }; | 10551 BreakStatement.prototype.get$label = function() { return this.label; }; |
| 10575 BreakStatement.prototype.set$label = function(value) { return this.label = value ; }; | 10552 BreakStatement.prototype.set$label = function(value) { return this.label = value ; }; |
| 10576 BreakStatement.prototype.visit = function(visitor) { | 10553 BreakStatement.prototype.visit = function(visitor) { |
| 10577 return visitor.visitBreakStatement(this); | 10554 return visitor.visitBreakStatement$1(this); |
| 10578 } | 10555 } |
| 10579 BreakStatement.prototype.visit$1 = BreakStatement.prototype.visit; | 10556 BreakStatement.prototype.visit$1 = BreakStatement.prototype.visit; |
| 10580 // ********** Code for ContinueStatement ************** | 10557 // ********** Code for ContinueStatement ************** |
| 10581 $inherits(ContinueStatement, Statement); | 10558 $inherits(ContinueStatement, Statement); |
| 10582 function ContinueStatement(label, span) { | 10559 function ContinueStatement(label, span) { |
| 10583 this.label = label; | 10560 this.label = label; |
| 10584 Statement.call(this, span); | 10561 Statement.call(this, span); |
| 10585 } | 10562 } |
| 10586 ContinueStatement.prototype.get$label = function() { return this.label; }; | 10563 ContinueStatement.prototype.get$label = function() { return this.label; }; |
| 10587 ContinueStatement.prototype.set$label = function(value) { return this.label = va lue; }; | 10564 ContinueStatement.prototype.set$label = function(value) { return this.label = va lue; }; |
| 10588 ContinueStatement.prototype.visit = function(visitor) { | 10565 ContinueStatement.prototype.visit = function(visitor) { |
| 10589 return visitor.visitContinueStatement(this); | 10566 return visitor.visitContinueStatement$1(this); |
| 10590 } | 10567 } |
| 10591 ContinueStatement.prototype.visit$1 = ContinueStatement.prototype.visit; | 10568 ContinueStatement.prototype.visit$1 = ContinueStatement.prototype.visit; |
| 10592 // ********** Code for IfStatement ************** | 10569 // ********** Code for IfStatement ************** |
| 10593 $inherits(IfStatement, Statement); | 10570 $inherits(IfStatement, Statement); |
| 10594 function IfStatement(test, trueBranch, falseBranch, span) { | 10571 function IfStatement(test, trueBranch, falseBranch, span) { |
| 10595 this.test = test; | 10572 this.test = test; |
| 10596 this.falseBranch = falseBranch; | 10573 this.falseBranch = falseBranch; |
| 10597 this.trueBranch = trueBranch; | 10574 this.trueBranch = trueBranch; |
| 10598 Statement.call(this, span); | 10575 Statement.call(this, span); |
| 10599 } | 10576 } |
| 10600 IfStatement.prototype.visit = function(visitor) { | 10577 IfStatement.prototype.visit = function(visitor) { |
| 10601 return visitor.visitIfStatement(this); | 10578 return visitor.visitIfStatement$1(this); |
| 10602 } | 10579 } |
| 10603 IfStatement.prototype.visit$1 = IfStatement.prototype.visit; | 10580 IfStatement.prototype.visit$1 = IfStatement.prototype.visit; |
| 10604 // ********** Code for WhileStatement ************** | 10581 // ********** Code for WhileStatement ************** |
| 10605 $inherits(WhileStatement, Statement); | 10582 $inherits(WhileStatement, Statement); |
| 10606 function WhileStatement(test, body, span) { | 10583 function WhileStatement(test, body, span) { |
| 10607 this.body = body; | 10584 this.body = body; |
| 10608 this.test = test; | 10585 this.test = test; |
| 10609 Statement.call(this, span); | 10586 Statement.call(this, span); |
| 10610 } | 10587 } |
| 10611 WhileStatement.prototype.get$body = function() { return this.body; }; | 10588 WhileStatement.prototype.get$body = function() { return this.body; }; |
| 10612 WhileStatement.prototype.set$body = function(value) { return this.body = value; }; | 10589 WhileStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10613 WhileStatement.prototype.visit = function(visitor) { | 10590 WhileStatement.prototype.visit = function(visitor) { |
| 10614 return visitor.visitWhileStatement(this); | 10591 return visitor.visitWhileStatement$1(this); |
| 10615 } | 10592 } |
| 10616 WhileStatement.prototype.visit$1 = WhileStatement.prototype.visit; | 10593 WhileStatement.prototype.visit$1 = WhileStatement.prototype.visit; |
| 10617 // ********** Code for DoStatement ************** | 10594 // ********** Code for DoStatement ************** |
| 10618 $inherits(DoStatement, Statement); | 10595 $inherits(DoStatement, Statement); |
| 10619 function DoStatement(body, test, span) { | 10596 function DoStatement(body, test, span) { |
| 10620 this.body = body; | 10597 this.body = body; |
| 10621 this.test = test; | 10598 this.test = test; |
| 10622 Statement.call(this, span); | 10599 Statement.call(this, span); |
| 10623 } | 10600 } |
| 10624 DoStatement.prototype.get$body = function() { return this.body; }; | 10601 DoStatement.prototype.get$body = function() { return this.body; }; |
| 10625 DoStatement.prototype.set$body = function(value) { return this.body = value; }; | 10602 DoStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10626 DoStatement.prototype.visit = function(visitor) { | 10603 DoStatement.prototype.visit = function(visitor) { |
| 10627 return visitor.visitDoStatement(this); | 10604 return visitor.visitDoStatement$1(this); |
| 10628 } | 10605 } |
| 10629 DoStatement.prototype.visit$1 = DoStatement.prototype.visit; | 10606 DoStatement.prototype.visit$1 = DoStatement.prototype.visit; |
| 10630 // ********** Code for ForStatement ************** | 10607 // ********** Code for ForStatement ************** |
| 10631 $inherits(ForStatement, Statement); | 10608 $inherits(ForStatement, Statement); |
| 10632 function ForStatement(init, test, step, body, span) { | 10609 function ForStatement(init, test, step, body, span) { |
| 10633 this.body = body; | 10610 this.body = body; |
| 10634 this.test = test; | 10611 this.test = test; |
| 10635 this.step = step; | 10612 this.step = step; |
| 10636 this.init = init; | 10613 this.init = init; |
| 10637 Statement.call(this, span); | 10614 Statement.call(this, span); |
| 10638 } | 10615 } |
| 10639 ForStatement.prototype.get$body = function() { return this.body; }; | 10616 ForStatement.prototype.get$body = function() { return this.body; }; |
| 10640 ForStatement.prototype.set$body = function(value) { return this.body = value; }; | 10617 ForStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10641 ForStatement.prototype.visit = function(visitor) { | 10618 ForStatement.prototype.visit = function(visitor) { |
| 10642 return visitor.visitForStatement(this); | 10619 return visitor.visitForStatement$1(this); |
| 10643 } | 10620 } |
| 10644 ForStatement.prototype.visit$1 = ForStatement.prototype.visit; | 10621 ForStatement.prototype.visit$1 = ForStatement.prototype.visit; |
| 10645 // ********** Code for ForInStatement ************** | 10622 // ********** Code for ForInStatement ************** |
| 10646 $inherits(ForInStatement, Statement); | 10623 $inherits(ForInStatement, Statement); |
| 10647 function ForInStatement(item, list, body, span) { | 10624 function ForInStatement(item, list, body, span) { |
| 10648 this.body = body; | 10625 this.body = body; |
| 10649 this.item = item; | 10626 this.item = item; |
| 10650 this.list = list; | 10627 this.list = list; |
| 10651 Statement.call(this, span); | 10628 Statement.call(this, span); |
| 10652 } | 10629 } |
| 10653 ForInStatement.prototype.get$body = function() { return this.body; }; | 10630 ForInStatement.prototype.get$body = function() { return this.body; }; |
| 10654 ForInStatement.prototype.set$body = function(value) { return this.body = value; }; | 10631 ForInStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10655 ForInStatement.prototype.visit = function(visitor) { | 10632 ForInStatement.prototype.visit = function(visitor) { |
| 10656 return visitor.visitForInStatement(this); | 10633 return visitor.visitForInStatement$1(this); |
| 10657 } | 10634 } |
| 10658 ForInStatement.prototype.visit$1 = ForInStatement.prototype.visit; | 10635 ForInStatement.prototype.visit$1 = ForInStatement.prototype.visit; |
| 10659 // ********** Code for TryStatement ************** | 10636 // ********** Code for TryStatement ************** |
| 10660 $inherits(TryStatement, Statement); | 10637 $inherits(TryStatement, Statement); |
| 10661 function TryStatement(body, catches, finallyBlock, span) { | 10638 function TryStatement(body, catches, finallyBlock, span) { |
| 10662 this.body = body; | 10639 this.body = body; |
| 10663 this.finallyBlock = finallyBlock; | 10640 this.finallyBlock = finallyBlock; |
| 10664 this.catches = catches; | 10641 this.catches = catches; |
| 10665 Statement.call(this, span); | 10642 Statement.call(this, span); |
| 10666 } | 10643 } |
| 10667 TryStatement.prototype.get$body = function() { return this.body; }; | 10644 TryStatement.prototype.get$body = function() { return this.body; }; |
| 10668 TryStatement.prototype.set$body = function(value) { return this.body = value; }; | 10645 TryStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10669 TryStatement.prototype.visit = function(visitor) { | 10646 TryStatement.prototype.visit = function(visitor) { |
| 10670 return visitor.visitTryStatement(this); | 10647 return visitor.visitTryStatement$1(this); |
| 10671 } | 10648 } |
| 10672 TryStatement.prototype.visit$1 = TryStatement.prototype.visit; | 10649 TryStatement.prototype.visit$1 = TryStatement.prototype.visit; |
| 10673 // ********** Code for SwitchStatement ************** | 10650 // ********** Code for SwitchStatement ************** |
| 10674 $inherits(SwitchStatement, Statement); | 10651 $inherits(SwitchStatement, Statement); |
| 10675 function SwitchStatement(test, cases, span) { | 10652 function SwitchStatement(test, cases, span) { |
| 10676 this.test = test; | 10653 this.test = test; |
| 10677 this.cases = cases; | 10654 this.cases = cases; |
| 10678 Statement.call(this, span); | 10655 Statement.call(this, span); |
| 10679 } | 10656 } |
| 10680 SwitchStatement.prototype.get$cases = function() { return this.cases; }; | 10657 SwitchStatement.prototype.get$cases = function() { return this.cases; }; |
| 10681 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu e; }; | 10658 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu e; }; |
| 10682 SwitchStatement.prototype.visit = function(visitor) { | 10659 SwitchStatement.prototype.visit = function(visitor) { |
| 10683 return visitor.visitSwitchStatement(this); | 10660 return visitor.visitSwitchStatement$1(this); |
| 10684 } | 10661 } |
| 10685 SwitchStatement.prototype.visit$1 = SwitchStatement.prototype.visit; | 10662 SwitchStatement.prototype.visit$1 = SwitchStatement.prototype.visit; |
| 10686 // ********** Code for BlockStatement ************** | 10663 // ********** Code for BlockStatement ************** |
| 10687 $inherits(BlockStatement, Statement); | 10664 $inherits(BlockStatement, Statement); |
| 10688 function BlockStatement(body, span) { | 10665 function BlockStatement(body, span) { |
| 10689 this.body = body; | 10666 this.body = body; |
| 10690 Statement.call(this, span); | 10667 Statement.call(this, span); |
| 10691 } | 10668 } |
| 10692 BlockStatement.prototype.get$body = function() { return this.body; }; | 10669 BlockStatement.prototype.get$body = function() { return this.body; }; |
| 10693 BlockStatement.prototype.set$body = function(value) { return this.body = value; }; | 10670 BlockStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10694 BlockStatement.prototype.visit = function(visitor) { | 10671 BlockStatement.prototype.visit = function(visitor) { |
| 10695 return visitor.visitBlockStatement(this); | 10672 return visitor.visitBlockStatement$1(this); |
| 10696 } | 10673 } |
| 10697 BlockStatement.prototype.visit$1 = BlockStatement.prototype.visit; | 10674 BlockStatement.prototype.visit$1 = BlockStatement.prototype.visit; |
| 10698 // ********** Code for LabeledStatement ************** | 10675 // ********** Code for LabeledStatement ************** |
| 10699 $inherits(LabeledStatement, Statement); | 10676 $inherits(LabeledStatement, Statement); |
| 10700 function LabeledStatement(name, body, span) { | 10677 function LabeledStatement(name, body, span) { |
| 10701 this.body = body; | 10678 this.body = body; |
| 10702 this.name = name; | 10679 this.name = name; |
| 10703 Statement.call(this, span); | 10680 Statement.call(this, span); |
| 10704 } | 10681 } |
| 10705 LabeledStatement.prototype.get$name = function() { return this.name; }; | 10682 LabeledStatement.prototype.get$name = function() { return this.name; }; |
| 10706 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; }; | 10683 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; }; |
| 10707 LabeledStatement.prototype.get$body = function() { return this.body; }; | 10684 LabeledStatement.prototype.get$body = function() { return this.body; }; |
| 10708 LabeledStatement.prototype.set$body = function(value) { return this.body = value ; }; | 10685 LabeledStatement.prototype.set$body = function(value) { return this.body = value ; }; |
| 10709 LabeledStatement.prototype.visit = function(visitor) { | 10686 LabeledStatement.prototype.visit = function(visitor) { |
| 10710 return visitor.visitLabeledStatement(this); | 10687 return visitor.visitLabeledStatement$1(this); |
| 10711 } | 10688 } |
| 10712 LabeledStatement.prototype.visit$1 = LabeledStatement.prototype.visit; | 10689 LabeledStatement.prototype.visit$1 = LabeledStatement.prototype.visit; |
| 10713 // ********** Code for ExpressionStatement ************** | 10690 // ********** Code for ExpressionStatement ************** |
| 10714 $inherits(ExpressionStatement, Statement); | 10691 $inherits(ExpressionStatement, Statement); |
| 10715 function ExpressionStatement(body, span) { | 10692 function ExpressionStatement(body, span) { |
| 10716 this.body = body; | 10693 this.body = body; |
| 10717 Statement.call(this, span); | 10694 Statement.call(this, span); |
| 10718 } | 10695 } |
| 10719 ExpressionStatement.prototype.get$body = function() { return this.body; }; | 10696 ExpressionStatement.prototype.get$body = function() { return this.body; }; |
| 10720 ExpressionStatement.prototype.set$body = function(value) { return this.body = va lue; }; | 10697 ExpressionStatement.prototype.set$body = function(value) { return this.body = va lue; }; |
| 10721 ExpressionStatement.prototype.visit = function(visitor) { | 10698 ExpressionStatement.prototype.visit = function(visitor) { |
| 10722 return visitor.visitExpressionStatement(this); | 10699 return visitor.visitExpressionStatement$1(this); |
| 10723 } | 10700 } |
| 10724 ExpressionStatement.prototype.visit$1 = ExpressionStatement.prototype.visit; | 10701 ExpressionStatement.prototype.visit$1 = ExpressionStatement.prototype.visit; |
| 10725 // ********** Code for EmptyStatement ************** | 10702 // ********** Code for EmptyStatement ************** |
| 10726 $inherits(EmptyStatement, Statement); | 10703 $inherits(EmptyStatement, Statement); |
| 10727 function EmptyStatement(span) { | 10704 function EmptyStatement(span) { |
| 10728 Statement.call(this, span); | 10705 Statement.call(this, span); |
| 10729 } | 10706 } |
| 10730 EmptyStatement.prototype.visit = function(visitor) { | 10707 EmptyStatement.prototype.visit = function(visitor) { |
| 10731 return visitor.visitEmptyStatement(this); | 10708 return visitor.visitEmptyStatement$1(this); |
| 10732 } | 10709 } |
| 10733 EmptyStatement.prototype.visit$1 = EmptyStatement.prototype.visit; | 10710 EmptyStatement.prototype.visit$1 = EmptyStatement.prototype.visit; |
| 10734 // ********** Code for DietStatement ************** | 10711 // ********** Code for DietStatement ************** |
| 10735 $inherits(DietStatement, Statement); | 10712 $inherits(DietStatement, Statement); |
| 10736 function DietStatement(span) { | 10713 function DietStatement(span) { |
| 10737 Statement.call(this, span); | 10714 Statement.call(this, span); |
| 10738 } | 10715 } |
| 10739 DietStatement.prototype.visit = function(visitor) { | 10716 DietStatement.prototype.visit = function(visitor) { |
| 10740 return visitor.visitDietStatement(this); | 10717 return visitor.visitDietStatement$1(this); |
| 10741 } | 10718 } |
| 10742 DietStatement.prototype.visit$1 = DietStatement.prototype.visit; | 10719 DietStatement.prototype.visit$1 = DietStatement.prototype.visit; |
| 10743 // ********** Code for LambdaExpression ************** | 10720 // ********** Code for LambdaExpression ************** |
| 10744 $inherits(LambdaExpression, Expression); | 10721 $inherits(LambdaExpression, Expression); |
| 10745 function LambdaExpression(func, span) { | 10722 function LambdaExpression(func, span) { |
| 10746 this.func = func; | 10723 this.func = func; |
| 10747 Expression.call(this, span); | 10724 Expression.call(this, span); |
| 10748 } | 10725 } |
| 10749 LambdaExpression.prototype.get$func = function() { return this.func; }; | 10726 LambdaExpression.prototype.get$func = function() { return this.func; }; |
| 10750 LambdaExpression.prototype.set$func = function(value) { return this.func = value ; }; | 10727 LambdaExpression.prototype.set$func = function(value) { return this.func = value ; }; |
| 10751 LambdaExpression.prototype.visit = function(visitor) { | 10728 LambdaExpression.prototype.visit = function(visitor) { |
| 10752 return visitor.visitLambdaExpression(this); | 10729 return visitor.visitLambdaExpression$1(this); |
| 10753 } | 10730 } |
| 10754 LambdaExpression.prototype.visit$1 = LambdaExpression.prototype.visit; | 10731 LambdaExpression.prototype.visit$1 = LambdaExpression.prototype.visit; |
| 10755 // ********** Code for CallExpression ************** | 10732 // ********** Code for CallExpression ************** |
| 10756 $inherits(CallExpression, Expression); | 10733 $inherits(CallExpression, Expression); |
| 10757 function CallExpression(target, arguments, span) { | 10734 function CallExpression(target, arguments, span) { |
| 10758 this.target = target; | 10735 this.target = target; |
| 10759 this.arguments = arguments; | 10736 this.arguments = arguments; |
| 10760 Expression.call(this, span); | 10737 Expression.call(this, span); |
| 10761 } | 10738 } |
| 10762 CallExpression.prototype.visit = function(visitor) { | 10739 CallExpression.prototype.visit = function(visitor) { |
| 10763 return visitor.visitCallExpression(this); | 10740 return visitor.visitCallExpression(this); |
| 10764 } | 10741 } |
| 10765 CallExpression.prototype.visit$1 = CallExpression.prototype.visit; | 10742 CallExpression.prototype.visit$1 = CallExpression.prototype.visit; |
| 10766 // ********** Code for IndexExpression ************** | 10743 // ********** Code for IndexExpression ************** |
| 10767 $inherits(IndexExpression, Expression); | 10744 $inherits(IndexExpression, Expression); |
| 10768 function IndexExpression(target, index, span) { | 10745 function IndexExpression(target, index, span) { |
| 10769 this.target = target; | 10746 this.target = target; |
| 10770 this.index = index; | 10747 this.index = index; |
| 10771 Expression.call(this, span); | 10748 Expression.call(this, span); |
| 10772 } | 10749 } |
| 10773 IndexExpression.prototype.visit = function(visitor) { | 10750 IndexExpression.prototype.visit = function(visitor) { |
| 10774 return visitor.visitIndexExpression(this); | 10751 return visitor.visitIndexExpression$1(this); |
| 10775 } | 10752 } |
| 10776 IndexExpression.prototype.visit$1 = IndexExpression.prototype.visit; | 10753 IndexExpression.prototype.visit$1 = IndexExpression.prototype.visit; |
| 10777 // ********** Code for BinaryExpression ************** | 10754 // ********** Code for BinaryExpression ************** |
| 10778 $inherits(BinaryExpression, Expression); | 10755 $inherits(BinaryExpression, Expression); |
| 10779 function BinaryExpression(op, x, y, span) { | 10756 function BinaryExpression(op, x, y, span) { |
| 10780 this.y = y; | 10757 this.y = y; |
| 10781 this.x = x; | 10758 this.x = x; |
| 10782 this.op = op; | 10759 this.op = op; |
| 10783 Expression.call(this, span); | 10760 Expression.call(this, span); |
| 10784 } | 10761 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10831 this.isConst = isConst; | 10808 this.isConst = isConst; |
| 10832 Expression.call(this, span); | 10809 Expression.call(this, span); |
| 10833 } | 10810 } |
| 10834 NewExpression.prototype.get$isConst = function() { return this.isConst; }; | 10811 NewExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10835 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; | 10812 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; |
| 10836 NewExpression.prototype.get$type = function() { return this.type; }; | 10813 NewExpression.prototype.get$type = function() { return this.type; }; |
| 10837 NewExpression.prototype.set$type = function(value) { return this.type = value; } ; | 10814 NewExpression.prototype.set$type = function(value) { return this.type = value; } ; |
| 10838 NewExpression.prototype.get$name = function() { return this.name; }; | 10815 NewExpression.prototype.get$name = function() { return this.name; }; |
| 10839 NewExpression.prototype.set$name = function(value) { return this.name = value; } ; | 10816 NewExpression.prototype.set$name = function(value) { return this.name = value; } ; |
| 10840 NewExpression.prototype.visit = function(visitor) { | 10817 NewExpression.prototype.visit = function(visitor) { |
| 10841 return visitor.visitNewExpression(this); | 10818 return visitor.visitNewExpression$1(this); |
| 10842 } | 10819 } |
| 10843 NewExpression.prototype.visit$1 = NewExpression.prototype.visit; | 10820 NewExpression.prototype.visit$1 = NewExpression.prototype.visit; |
| 10844 // ********** Code for ListExpression ************** | 10821 // ********** Code for ListExpression ************** |
| 10845 $inherits(ListExpression, Expression); | 10822 $inherits(ListExpression, Expression); |
| 10846 function ListExpression(isConst, itemType, values, span) { | 10823 function ListExpression(isConst, itemType, values, span) { |
| 10847 this.itemType = itemType; | 10824 this.itemType = itemType; |
| 10848 this.isConst = isConst; | 10825 this.isConst = isConst; |
| 10849 this.values = values; | 10826 this.values = values; |
| 10850 Expression.call(this, span); | 10827 Expression.call(this, span); |
| 10851 } | 10828 } |
| 10852 ListExpression.prototype.get$isConst = function() { return this.isConst; }; | 10829 ListExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10853 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; }; | 10830 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; }; |
| 10854 ListExpression.prototype.visit = function(visitor) { | 10831 ListExpression.prototype.visit = function(visitor) { |
| 10855 return visitor.visitListExpression(this); | 10832 return visitor.visitListExpression(this); |
| 10856 } | 10833 } |
| 10857 ListExpression.prototype.visit$1 = ListExpression.prototype.visit; | 10834 ListExpression.prototype.visit$1 = ListExpression.prototype.visit; |
| 10858 // ********** Code for MapExpression ************** | 10835 // ********** Code for MapExpression ************** |
| 10859 $inherits(MapExpression, Expression); | 10836 $inherits(MapExpression, Expression); |
| 10860 function MapExpression(isConst, keyType, valueType, items, span) { | 10837 function MapExpression(isConst, keyType, valueType, items, span) { |
| 10861 this.keyType = keyType; | 10838 this.keyType = keyType; |
| 10862 this.valueType = valueType; | 10839 this.valueType = valueType; |
| 10863 this.items = items; | 10840 this.items = items; |
| 10864 this.isConst = isConst; | 10841 this.isConst = isConst; |
| 10865 Expression.call(this, span); | 10842 Expression.call(this, span); |
| 10866 } | 10843 } |
| 10867 MapExpression.prototype.get$isConst = function() { return this.isConst; }; | 10844 MapExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10868 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; | 10845 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; |
| 10869 MapExpression.prototype.visit = function(visitor) { | 10846 MapExpression.prototype.visit = function(visitor) { |
| 10870 return visitor.visitMapExpression(this); | 10847 return visitor.visitMapExpression$1(this); |
| 10871 } | 10848 } |
| 10872 MapExpression.prototype.visit$1 = MapExpression.prototype.visit; | 10849 MapExpression.prototype.visit$1 = MapExpression.prototype.visit; |
| 10873 // ********** Code for ConditionalExpression ************** | 10850 // ********** Code for ConditionalExpression ************** |
| 10874 $inherits(ConditionalExpression, Expression); | 10851 $inherits(ConditionalExpression, Expression); |
| 10875 function ConditionalExpression(test, trueBranch, falseBranch, span) { | 10852 function ConditionalExpression(test, trueBranch, falseBranch, span) { |
| 10876 this.test = test; | 10853 this.test = test; |
| 10877 this.falseBranch = falseBranch; | 10854 this.falseBranch = falseBranch; |
| 10878 this.trueBranch = trueBranch; | 10855 this.trueBranch = trueBranch; |
| 10879 Expression.call(this, span); | 10856 Expression.call(this, span); |
| 10880 } | 10857 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10969 SuperExpression.prototype.visit$1 = SuperExpression.prototype.visit; | 10946 SuperExpression.prototype.visit$1 = SuperExpression.prototype.visit; |
| 10970 // ********** Code for LiteralExpression ************** | 10947 // ********** Code for LiteralExpression ************** |
| 10971 $inherits(LiteralExpression, Expression); | 10948 $inherits(LiteralExpression, Expression); |
| 10972 function LiteralExpression(value, span) { | 10949 function LiteralExpression(value, span) { |
| 10973 this.value = value; | 10950 this.value = value; |
| 10974 Expression.call(this, span); | 10951 Expression.call(this, span); |
| 10975 } | 10952 } |
| 10976 LiteralExpression.prototype.get$value = function() { return this.value; }; | 10953 LiteralExpression.prototype.get$value = function() { return this.value; }; |
| 10977 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; }; | 10954 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; }; |
| 10978 LiteralExpression.prototype.visit = function(visitor) { | 10955 LiteralExpression.prototype.visit = function(visitor) { |
| 10979 return visitor.visitLiteralExpression(this); | 10956 return visitor.visitLiteralExpression$1(this); |
| 10980 } | 10957 } |
| 10981 LiteralExpression.prototype.visit$1 = LiteralExpression.prototype.visit; | 10958 LiteralExpression.prototype.visit$1 = LiteralExpression.prototype.visit; |
| 10982 // ********** Code for StringInterpExpression ************** | 10959 // ********** Code for StringInterpExpression ************** |
| 10983 $inherits(StringInterpExpression, Expression); | 10960 $inherits(StringInterpExpression, Expression); |
| 10984 function StringInterpExpression(pieces, span) { | 10961 function StringInterpExpression(pieces, span) { |
| 10985 this.pieces = pieces; | 10962 this.pieces = pieces; |
| 10986 Expression.call(this, span); | 10963 Expression.call(this, span); |
| 10987 } | 10964 } |
| 10988 StringInterpExpression.prototype.visit = function(visitor) { | 10965 StringInterpExpression.prototype.visit = function(visitor) { |
| 10989 return visitor.visitStringInterpExpression(this); | 10966 return visitor.visitStringInterpExpression(this); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11159 function DeclaredIdentifier(type, name, span) { | 11136 function DeclaredIdentifier(type, name, span) { |
| 11160 this.name = name; | 11137 this.name = name; |
| 11161 this.type = type; | 11138 this.type = type; |
| 11162 Expression.call(this, span); | 11139 Expression.call(this, span); |
| 11163 } | 11140 } |
| 11164 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; | 11141 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; |
| 11165 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; }; | 11142 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; }; |
| 11166 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; | 11143 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; |
| 11167 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; }; | 11144 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; }; |
| 11168 DeclaredIdentifier.prototype.visit = function(visitor) { | 11145 DeclaredIdentifier.prototype.visit = function(visitor) { |
| 11169 return visitor.visitDeclaredIdentifier(this); | 11146 return visitor.visitDeclaredIdentifier$1(this); |
| 11170 } | 11147 } |
| 11171 DeclaredIdentifier.prototype.visit$1 = DeclaredIdentifier.prototype.visit; | 11148 DeclaredIdentifier.prototype.visit$1 = DeclaredIdentifier.prototype.visit; |
| 11172 // ********** Code for Type ************** | 11149 // ********** Code for Type ************** |
| 11173 $inherits(Type, Element); | 11150 $inherits(Type, Element); |
| 11174 function Type(name) { | 11151 function Type(name) { |
| 11175 this.isTested = false; | 11152 this.isTested = false; |
| 11176 this._resolvedMembers = new HashMapImplementation(); | 11153 this._foundMembers = new HashMapImplementation(); |
| 11177 this.isChecked = false; | 11154 this.isChecked = false; |
| 11178 this.isWritten = false; | 11155 this.isWritten = false; |
| 11179 this.varStubs = new HashMapImplementation(); | 11156 this.varStubs = new HashMapImplementation(); |
| 11180 Element.call(this, name, null); | 11157 Element.call(this, name, null); |
| 11181 } | 11158 } |
| 11182 Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; }; | 11159 Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; }; |
| 11183 Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckCode = value; }; | 11160 Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckCode = value; }; |
| 11184 Type.prototype.get$varStubs = function() { return this.varStubs; }; | 11161 Type.prototype.get$varStubs = function() { return this.varStubs; }; |
| 11185 Type.prototype.set$varStubs = function(value) { return this.varStubs = value; }; | 11162 Type.prototype.set$varStubs = function(value) { return this.varStubs = value; }; |
| 11186 Type.prototype.markUsed = function() { | 11163 Type.prototype.markUsed = function() { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11312 var typeParam = params.next$0(); | 11289 var typeParam = params.next$0(); |
| 11313 var typeArg = args.next$0(); | 11290 var typeArg = args.next$0(); |
| 11314 if (typeParam.get$extendsType() != null && typeArg != null) { | 11291 if (typeParam.get$extendsType() != null && typeArg != null) { |
| 11315 typeArg.ensureSubtypeOf$3(typeParam.get$extendsType(), typeParam.get$spa n(), true); | 11292 typeArg.ensureSubtypeOf$3(typeParam.get$extendsType(), typeParam.get$spa n(), true); |
| 11316 } | 11293 } |
| 11317 } | 11294 } |
| 11318 } | 11295 } |
| 11319 if (this.get$interfaces() != null) { | 11296 if (this.get$interfaces() != null) { |
| 11320 var $$list = this.get$interfaces(); | 11297 var $$list = this.get$interfaces(); |
| 11321 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11298 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11322 var i = $$list.$index($$i); | 11299 var i = $$list[$$i]; |
| 11323 i._checkExtends$0(); | 11300 i._checkExtends$0(); |
| 11324 } | 11301 } |
| 11325 } | 11302 } |
| 11326 } | 11303 } |
| 11327 Type.prototype._checkOverride = function(member) { | 11304 Type.prototype._checkOverride = function(member) { |
| 11328 var parentMember = this._getMemberInParents(member.name); | 11305 var parentMember = this._getMemberInParents(member.name); |
| 11329 if (parentMember != null) { | 11306 if (parentMember != null) { |
| 11330 if (!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$li brary())) { | 11307 if (!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$li brary())) { |
| 11331 member.override(parentMember); | 11308 member.override(parentMember); |
| 11332 } | 11309 } |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 11351 return this.get$parent().getMember(memberName); | 11328 return this.get$parent().getMember(memberName); |
| 11352 } | 11329 } |
| 11353 else { | 11330 else { |
| 11354 return null; | 11331 return null; |
| 11355 } | 11332 } |
| 11356 } | 11333 } |
| 11357 else { | 11334 else { |
| 11358 if (this.get$interfaces() != null && this.get$interfaces().get$length() > (0 )) { | 11335 if (this.get$interfaces() != null && this.get$interfaces().get$length() > (0 )) { |
| 11359 var $$list = this.get$interfaces(); | 11336 var $$list = this.get$interfaces(); |
| 11360 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11337 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11361 var i = $$list.$index($$i); | 11338 var i = $$list[$$i]; |
| 11362 var ret = i.getMember$1(memberName); | 11339 var ret = i.getMember$1(memberName); |
| 11363 if (ret != null) { | 11340 if (ret != null) { |
| 11364 return ret; | 11341 return ret; |
| 11365 } | 11342 } |
| 11366 } | 11343 } |
| 11367 } | 11344 } |
| 11368 return $globals.world.objectType.getMember(memberName); | 11345 return $globals.world.objectType.getMember(memberName); |
| 11369 } | 11346 } |
| 11370 } | 11347 } |
| 11371 Type.prototype.resolveMember = function(memberName) { | |
| 11372 var ret = this._resolvedMembers.$index(memberName); | |
| 11373 if (ret != null) return ret; | |
| 11374 var member = this.getMember(memberName); | |
| 11375 if (member == null) { | |
| 11376 return null; | |
| 11377 } | |
| 11378 ret = new MemberSet(member, false); | |
| 11379 this._resolvedMembers.$setindex(memberName, ret); | |
| 11380 if (member.get$isStatic()) { | |
| 11381 return ret; | |
| 11382 } | |
| 11383 else { | |
| 11384 var $$list = this.get$subtypes(); | |
| 11385 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | |
| 11386 var t = $$i.next$0(); | |
| 11387 if (!this.get$isClass() && t.get$isClass()) { | |
| 11388 var m = t.getMember$1(memberName); | |
| 11389 if (m != null && ret.members.indexOf(m) == (-1)) { | |
| 11390 ret.add(m); | |
| 11391 } | |
| 11392 } | |
| 11393 else { | |
| 11394 var m = t.get$members().$index(memberName); | |
| 11395 if (m != null) ret.add(m); | |
| 11396 } | |
| 11397 } | |
| 11398 return ret; | |
| 11399 } | |
| 11400 } | |
| 11401 Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { | 11348 Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { |
| 11402 if (!this.isSubtypeOf(other)) { | 11349 if (!this.isSubtypeOf(other)) { |
| 11403 var msg = ("type " + this.name + " is not a subtype of " + other.name); | 11350 var msg = ("type " + this.name + " is not a subtype of " + other.name); |
| 11404 if (typeErrors) { | 11351 if (typeErrors) { |
| 11405 $globals.world.error(msg, span); | 11352 $globals.world.error(msg, span); |
| 11406 } | 11353 } |
| 11407 else { | 11354 else { |
| 11408 $globals.world.warning(msg, span); | 11355 $globals.world.warning(msg, span); |
| 11409 } | 11356 } |
| 11410 } | 11357 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11539 } | 11486 } |
| 11540 ParameterType.prototype.getCallMethod = function() { | 11487 ParameterType.prototype.getCallMethod = function() { |
| 11541 return this.extendsType.getCallMethod(); | 11488 return this.extendsType.getCallMethod(); |
| 11542 } | 11489 } |
| 11543 ParameterType.prototype.genMethod = function(method) { | 11490 ParameterType.prototype.genMethod = function(method) { |
| 11544 this.extendsType.genMethod(method); | 11491 this.extendsType.genMethod(method); |
| 11545 } | 11492 } |
| 11546 ParameterType.prototype.isSubtypeOf = function(other) { | 11493 ParameterType.prototype.isSubtypeOf = function(other) { |
| 11547 return true; | 11494 return true; |
| 11548 } | 11495 } |
| 11549 ParameterType.prototype.resolveMember = function(memberName) { | |
| 11550 return this.extendsType.resolveMember(memberName); | |
| 11551 } | |
| 11552 ParameterType.prototype.getConstructor = function(constructorName) { | 11496 ParameterType.prototype.getConstructor = function(constructorName) { |
| 11553 $globals.world.internalError("no constructors on type parameters yet"); | 11497 $globals.world.internalError("no constructors on type parameters yet"); |
| 11554 } | 11498 } |
| 11555 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11499 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 11556 $globals.world.internalError("no concrete types of type parameters yet", this. get$span()); | 11500 $globals.world.internalError("no concrete types of type parameters yet", this. get$span()); |
| 11557 } | 11501 } |
| 11558 ParameterType.prototype.resolveTypeParams = function(inType) { | 11502 ParameterType.prototype.resolveTypeParams = function(inType) { |
| 11559 return inType.typeArguments.$index(this.name); | 11503 return inType.typeArguments.$index(this.name); |
| 11560 } | 11504 } |
| 11561 ParameterType.prototype.addDirectSubtype = function(type) { | 11505 ParameterType.prototype.addDirectSubtype = function(type) { |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 11588 NonNullableType.prototype.get$isBool = function() { | 11532 NonNullableType.prototype.get$isBool = function() { |
| 11589 return this.type.get$isBool(); | 11533 return this.type.get$isBool(); |
| 11590 } | 11534 } |
| 11591 NonNullableType.prototype.get$isUsed = function() { | 11535 NonNullableType.prototype.get$isUsed = function() { |
| 11592 return false; | 11536 return false; |
| 11593 } | 11537 } |
| 11594 NonNullableType.prototype.isSubtypeOf = function(other) { | 11538 NonNullableType.prototype.isSubtypeOf = function(other) { |
| 11595 return $eq(this, other) || $eq(this.type, other) || this.type.isSubtypeOf(othe r); | 11539 return $eq(this, other) || $eq(this.type, other) || this.type.isSubtypeOf(othe r); |
| 11596 } | 11540 } |
| 11597 NonNullableType.prototype.resolveType = function(node, isRequired) { | 11541 NonNullableType.prototype.resolveType = function(node, isRequired) { |
| 11598 return this.type.resolveType(node, isRequired); | 11542 return this.type.resolveType$2(node, isRequired); |
| 11599 } | 11543 } |
| 11600 NonNullableType.prototype.resolveTypeParams = function(inType) { | 11544 NonNullableType.prototype.resolveTypeParams = function(inType) { |
| 11601 return this.type.resolveTypeParams(inType); | 11545 return this.type.resolveTypeParams(inType); |
| 11602 } | 11546 } |
| 11603 NonNullableType.prototype.addDirectSubtype = function(subtype) { | 11547 NonNullableType.prototype.addDirectSubtype = function(subtype) { |
| 11604 this.type.addDirectSubtype(subtype); | 11548 this.type.addDirectSubtype$1(subtype); |
| 11605 } | 11549 } |
| 11606 NonNullableType.prototype.markUsed = function() { | 11550 NonNullableType.prototype.markUsed = function() { |
| 11607 this.type.markUsed(); | 11551 this.type.markUsed(); |
| 11608 } | 11552 } |
| 11609 NonNullableType.prototype.genMethod = function(method) { | 11553 NonNullableType.prototype.genMethod = function(method) { |
| 11610 this.type.genMethod(method); | 11554 this.type.genMethod(method); |
| 11611 } | 11555 } |
| 11612 NonNullableType.prototype.get$span = function() { | 11556 NonNullableType.prototype.get$span = function() { |
| 11613 return this.type.get$span(); | 11557 return this.type.get$span(); |
| 11614 } | 11558 } |
| 11615 NonNullableType.prototype.resolveMember = function(name) { | |
| 11616 return this.type.resolveMember(name); | |
| 11617 } | |
| 11618 NonNullableType.prototype.getMember = function(name) { | 11559 NonNullableType.prototype.getMember = function(name) { |
| 11619 return this.type.getMember(name); | 11560 return this.type.getMember(name); |
| 11620 } | 11561 } |
| 11621 NonNullableType.prototype.getConstructor = function(name) { | 11562 NonNullableType.prototype.getConstructor = function(name) { |
| 11622 return this.type.getConstructor$1(name); | 11563 return this.type.getConstructor$1(name); |
| 11623 } | 11564 } |
| 11624 NonNullableType.prototype.getFactory = function(t, name) { | 11565 NonNullableType.prototype.getFactory = function(t, name) { |
| 11625 return this.type.getFactory$2(t, name); | 11566 return this.type.getFactory$2(t, name); |
| 11626 } | 11567 } |
| 11627 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11568 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11712 ConcreteType.prototype.get$isClass = function() { | 11653 ConcreteType.prototype.get$isClass = function() { |
| 11713 return this.genericType.isClass; | 11654 return this.genericType.isClass; |
| 11714 } | 11655 } |
| 11715 ConcreteType.prototype.get$library = function() { | 11656 ConcreteType.prototype.get$library = function() { |
| 11716 return this.genericType.library; | 11657 return this.genericType.library; |
| 11717 } | 11658 } |
| 11718 ConcreteType.prototype.get$span = function() { | 11659 ConcreteType.prototype.get$span = function() { |
| 11719 return this.genericType.get$span(); | 11660 return this.genericType.get$span(); |
| 11720 } | 11661 } |
| 11721 ConcreteType.prototype.get$hasTypeParams = function() { | 11662 ConcreteType.prototype.get$hasTypeParams = function() { |
| 11722 return this.typeArguments.getValues$0().some$1((function (e) { | 11663 return this.typeArguments.getValues().some((function (e) { |
| 11723 return (e instanceof ParameterType); | 11664 return (e instanceof ParameterType); |
| 11724 }) | 11665 }) |
| 11725 ); | 11666 ); |
| 11726 } | 11667 } |
| 11727 ConcreteType.prototype.get$isUsed = function() { return this.isUsed; }; | 11668 ConcreteType.prototype.get$isUsed = function() { return this.isUsed; }; |
| 11728 ConcreteType.prototype.set$isUsed = function(value) { return this.isUsed = value ; }; | 11669 ConcreteType.prototype.set$isUsed = function(value) { return this.isUsed = value ; }; |
| 11729 ConcreteType.prototype.get$members = function() { return this.members; }; | 11670 ConcreteType.prototype.get$members = function() { return this.members; }; |
| 11730 ConcreteType.prototype.set$members = function(value) { return this.members = val ue; }; | 11671 ConcreteType.prototype.set$members = function(value) { return this.members = val ue; }; |
| 11731 ConcreteType.prototype.get$constructors = function() { return this.constructors; }; | 11672 ConcreteType.prototype.get$constructors = function() { return this.constructors; }; |
| 11732 ConcreteType.prototype.set$constructors = function(value) { return this.construc tors = value; }; | 11673 ConcreteType.prototype.set$constructors = function(value) { return this.construc tors = value; }; |
| 11733 ConcreteType.prototype.get$factories = function() { return this.factories; }; | 11674 ConcreteType.prototype.get$factories = function() { return this.factories; }; |
| 11734 ConcreteType.prototype.set$factories = function(value) { return this.factories = value; }; | 11675 ConcreteType.prototype.set$factories = function(value) { return this.factories = value; }; |
| 11735 ConcreteType.prototype.resolveTypeParams = function(inType) { | 11676 ConcreteType.prototype.resolveTypeParams = function(inType) { |
| 11736 var newTypeArgs = []; | 11677 var newTypeArgs = []; |
| 11737 var needsNewType = false; | 11678 var needsNewType = false; |
| 11738 var $$list = this.typeArgsInOrder; | 11679 var $$list = this.typeArgsInOrder; |
| 11739 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11680 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11740 var t = $$list.$index($$i); | 11681 var t = $$list[$$i]; |
| 11741 var newType = t.resolveTypeParams$1(inType); | 11682 var newType = t.resolveTypeParams$1(inType); |
| 11742 if ($ne(newType, t)) needsNewType = true; | 11683 if ($ne(newType, t)) needsNewType = true; |
| 11743 newTypeArgs.add$1(newType); | 11684 newTypeArgs.add$1(newType); |
| 11744 } | 11685 } |
| 11745 if (!needsNewType) return this; | 11686 if (!needsNewType) return this; |
| 11746 return this.genericType.getOrMakeConcreteType(newTypeArgs); | 11687 return this.genericType.getOrMakeConcreteType(newTypeArgs); |
| 11747 } | 11688 } |
| 11748 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11689 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 11749 return this.genericType.getOrMakeConcreteType(typeArgs); | 11690 return this.genericType.getOrMakeConcreteType(typeArgs); |
| 11750 } | 11691 } |
| 11751 ConcreteType.prototype.get$parent = function() { | 11692 ConcreteType.prototype.get$parent = function() { |
| 11752 if (this._parent == null && this.genericType.get$parent() != null) { | 11693 if (this._parent == null && this.genericType.get$parent() != null) { |
| 11753 this._parent = this.genericType.get$parent().resolveTypeParams(this); | 11694 this._parent = this.genericType.get$parent().resolveTypeParams(this); |
| 11754 } | 11695 } |
| 11755 return this._parent; | 11696 return this._parent; |
| 11756 } | 11697 } |
| 11757 ConcreteType.prototype.get$interfaces = function() { | 11698 ConcreteType.prototype.get$interfaces = function() { |
| 11758 if (this._interfaces == null && this.genericType.interfaces != null) { | 11699 if (this._interfaces == null && this.genericType.interfaces != null) { |
| 11759 this._interfaces = []; | 11700 this._interfaces = []; |
| 11760 var $$list = this.genericType.interfaces; | 11701 var $$list = this.genericType.interfaces; |
| 11761 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11702 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11762 var i = $$list.$index($$i); | 11703 var i = $$list[$$i]; |
| 11763 this._interfaces.add(i.resolveTypeParams$1(this)); | 11704 this._interfaces.add(i.resolveTypeParams$1(this)); |
| 11764 } | 11705 } |
| 11765 } | 11706 } |
| 11766 return this._interfaces; | 11707 return this._interfaces; |
| 11767 } | 11708 } |
| 11768 ConcreteType.prototype.get$subtypes = function() { | 11709 ConcreteType.prototype.get$subtypes = function() { |
| 11769 if (this._subtypes == null) { | 11710 if (this._subtypes == null) { |
| 11770 this._subtypes = new HashSetImplementation(); | 11711 this._subtypes = new HashSetImplementation(); |
| 11771 var $$list = this.genericType.get$subtypes(); | 11712 var $$list = this.genericType.get$subtypes(); |
| 11772 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 11713 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11821 ret = new ConcreteMember(genericMember.get$name(), this, genericMember); | 11762 ret = new ConcreteMember(genericMember.get$name(), this, genericMember); |
| 11822 this.factories.addFactory(this.name, constructorName, ret); | 11763 this.factories.addFactory(this.name, constructorName, ret); |
| 11823 } | 11764 } |
| 11824 else { | 11765 else { |
| 11825 ret = new ConcreteMember(this.name, this, genericMember); | 11766 ret = new ConcreteMember(this.name, this, genericMember); |
| 11826 this.constructors.$setindex(constructorName, ret); | 11767 this.constructors.$setindex(constructorName, ret); |
| 11827 } | 11768 } |
| 11828 return ret; | 11769 return ret; |
| 11829 } | 11770 } |
| 11830 ConcreteType.prototype.getMember = function(memberName) { | 11771 ConcreteType.prototype.getMember = function(memberName) { |
| 11831 var member = this.members.$index(memberName); | 11772 var member = this._foundMembers.$index(memberName); |
| 11773 if (member != null) return member; | |
| 11774 member = this.members.$index(memberName); | |
| 11832 if (member != null) { | 11775 if (member != null) { |
| 11833 this._checkOverride(member); | 11776 this._checkOverride(member); |
| 11777 this._foundMembers.$setindex(memberName, member); | |
| 11834 return member; | 11778 return member; |
| 11835 } | 11779 } |
| 11836 var genericMember = this.genericType.members.$index(memberName); | 11780 var genericMember = this.genericType.members.$index(memberName); |
| 11837 if (genericMember != null) { | 11781 if (genericMember != null) { |
| 11838 member = new ConcreteMember(genericMember.get$name(), this, genericMember); | 11782 member = new ConcreteMember(genericMember.get$name(), this, genericMember); |
| 11839 this.members.$setindex(memberName, member); | 11783 this.members.$setindex(memberName, member); |
| 11784 this._foundMembers.$setindex(memberName, member); | |
| 11840 return member; | 11785 return member; |
| 11841 } | 11786 } |
| 11842 return this._getMemberInParents(memberName); | 11787 member = this._getMemberInParents(memberName); |
| 11788 this._foundMembers.$setindex(memberName, member); | |
| 11789 return member; | |
| 11843 } | 11790 } |
| 11844 ConcreteType.prototype.resolveType = function(node, isRequired) { | 11791 ConcreteType.prototype.resolveType = function(node, isRequired) { |
| 11845 var ret = this.genericType.resolveType(node, isRequired); | 11792 var ret = this.genericType.resolveType$2(node, isRequired); |
| 11846 return ret; | 11793 return ret; |
| 11847 } | 11794 } |
| 11848 ConcreteType.prototype.addDirectSubtype = function(type) { | 11795 ConcreteType.prototype.addDirectSubtype = function(type) { |
| 11849 this.genericType.addDirectSubtype(type); | 11796 this.genericType.addDirectSubtype(type); |
| 11850 } | 11797 } |
| 11851 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt ype; | 11798 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt ype; |
| 11852 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; | 11799 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; |
| 11853 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; | 11800 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; |
| 11854 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; | 11801 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; |
| 11855 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak eConcreteType; | 11802 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak eConcreteType; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11952 } | 11899 } |
| 11953 DefinedType.prototype.get$typeofName = function() { | 11900 DefinedType.prototype.get$typeofName = function() { |
| 11954 if (!this.library.get$isCore()) return null; | 11901 if (!this.library.get$isCore()) return null; |
| 11955 if (this.get$isBool()) return "boolean"; | 11902 if (this.get$isBool()) return "boolean"; |
| 11956 else if (this.get$isNum()) return "number"; | 11903 else if (this.get$isNum()) return "number"; |
| 11957 else if (this.get$isString()) return "string"; | 11904 else if (this.get$isString()) return "string"; |
| 11958 else if (this.get$isFunction()) return "function"; | 11905 else if (this.get$isFunction()) return "function"; |
| 11959 else return null; | 11906 else return null; |
| 11960 } | 11907 } |
| 11961 DefinedType.prototype.get$isNum = function() { | 11908 DefinedType.prototype.get$isNum = function() { |
| 11962 return this.library != null && this.library.get$isCore() && (this.name == "num " || this.name == "int" || this.name == "double"); | 11909 return $eq(this, $globals.world.numType) || $eq(this, $globals.world.intType) || $eq(this, $globals.world.doubleType) || $eq(this, $globals.world.numImplType) ; |
| 11963 } | 11910 } |
| 11964 DefinedType.prototype.getCallMethod = function() { | 11911 DefinedType.prototype.getCallMethod = function() { |
| 11965 return this.members.$index(":call"); | 11912 return this.members.$index(":call"); |
| 11966 } | 11913 } |
| 11967 DefinedType.prototype.getAllMembers = function() { | 11914 DefinedType.prototype.getAllMembers = function() { |
| 11968 return HashMapImplementation.HashMapImplementation$from$factory(this.members); | 11915 return HashMapImplementation.HashMapImplementation$from$factory(this.members); |
| 11969 } | 11916 } |
| 11970 DefinedType.prototype.markUsed = function() { | 11917 DefinedType.prototype.markUsed = function() { |
| 11971 if (this.isUsed) return; | 11918 if (this.isUsed) return; |
| 11972 this.isUsed = true; | 11919 this.isUsed = true; |
| 11973 this._checkExtends(); | 11920 this._checkExtends(); |
| 11974 if (this._lazyGenMethods != null) { | 11921 if (this._lazyGenMethods != null) { |
| 11975 var $$list = orderValuesByKeys(this._lazyGenMethods); | 11922 var $$list = orderValuesByKeys(this._lazyGenMethods); |
| 11976 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11923 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11977 var method = $$list.$index($$i); | 11924 var method = $$list[$$i]; |
| 11978 $globals.world.gen.genMethod(method); | 11925 $globals.world.gen.genMethod(method); |
| 11979 } | 11926 } |
| 11980 this._lazyGenMethods = null; | 11927 this._lazyGenMethods = null; |
| 11981 } | 11928 } |
| 11982 if (this.get$parent() != null) this.get$parent().markUsed(); | 11929 if (this.get$parent() != null) this.get$parent().markUsed(); |
| 11983 } | 11930 } |
| 11984 DefinedType.prototype.genMethod = function(method) { | 11931 DefinedType.prototype.genMethod = function(method) { |
| 11985 if (this.isUsed) { | 11932 if (this.isUsed) { |
| 11986 $globals.world.gen.genMethod(method); | 11933 $globals.world.gen.genMethod(method); |
| 11987 } | 11934 } |
| 11988 else if (this.isClass) { | 11935 else if (this.isClass) { |
| 11989 if (this._lazyGenMethods == null) this._lazyGenMethods = new HashMapImplemen tation(); | 11936 if (this._lazyGenMethods == null) this._lazyGenMethods = new HashMapImplemen tation(); |
| 11990 this._lazyGenMethods.$setindex(method.name, method); | 11937 this._lazyGenMethods.$setindex(method.name, method); |
| 11991 } | 11938 } |
| 11992 } | 11939 } |
| 11993 DefinedType.prototype._resolveInterfaces = function(types) { | 11940 DefinedType.prototype._resolveInterfaces = function(types) { |
| 11994 if (types == null) return []; | 11941 if (types == null) return []; |
| 11995 var interfaces = []; | 11942 var interfaces = []; |
| 11996 for (var $$i = 0;$$i < types.get$length(); $$i++) { | 11943 for (var $$i = 0;$$i < types.get$length(); $$i++) { |
| 11997 var type = types.$index($$i); | 11944 var type = types[$$i]; |
| 11998 var resolvedInterface = this.resolveType(type, true); | 11945 var resolvedInterface = this.resolveType$2(type, true); |
| 11999 if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this. library.get$isCoreImpl())) { | 11946 if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this. library.get$isCoreImpl())) { |
| 12000 $globals.world.error(("can not implement \"" + resolvedInterface.get$name( ) + "\": ") + "only native implementation allowed", type.get$span()); | 11947 $globals.world.error(("can not implement \"" + resolvedInterface.get$name( ) + "\": ") + "only native implementation allowed", type.get$span()); |
| 12001 } | 11948 } |
| 12002 resolvedInterface.addDirectSubtype$1(this); | 11949 resolvedInterface.addDirectSubtype$1(this); |
| 12003 interfaces.add$1(resolvedInterface); | 11950 interfaces.add$1(resolvedInterface); |
| 12004 } | 11951 } |
| 12005 return interfaces; | 11952 return interfaces; |
| 12006 } | 11953 } |
| 12007 DefinedType.prototype.addDirectSubtype = function(type) { | 11954 DefinedType.prototype.addDirectSubtype = function(type) { |
| 12008 this.directSubtypes.add(type); | 11955 this.directSubtypes.add(type); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12043 if (ancestor == null) return false; | 11990 if (ancestor == null) return false; |
| 12044 if (ancestor == $this) return true; | 11991 if (ancestor == $this) return true; |
| 12045 if (seen.contains$1(ancestor)) { | 11992 if (seen.contains$1(ancestor)) { |
| 12046 return false; | 11993 return false; |
| 12047 } | 11994 } |
| 12048 seen.add$1(ancestor); | 11995 seen.add$1(ancestor); |
| 12049 if (ancestor.get$interfaces() != null) { | 11996 if (ancestor.get$interfaces() != null) { |
| 12050 var $$list = ancestor.get$interfaces(); | 11997 var $$list = ancestor.get$interfaces(); |
| 12051 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 11998 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12052 var parent = $$i.next$0(); | 11999 var parent = $$i.next$0(); |
| 12053 if (_helper(parent)) return true; | 12000 if (_helper.call$1(parent)) return true; |
| 12054 } | 12001 } |
| 12055 } | 12002 } |
| 12056 return false; | 12003 return false; |
| 12057 } | 12004 } |
| 12058 for (var i = (0); | 12005 for (var i = (0); |
| 12059 i < this.interfaces.get$length(); i++) { | 12006 i < this.interfaces.get$length(); i++) { |
| 12060 if (_helper(this.interfaces.$index(i))) return i; | 12007 if (_helper.call$1(this.interfaces[i])) return i; |
| 12061 } | 12008 } |
| 12062 return (-1); | 12009 return (-1); |
| 12063 } | 12010 } |
| 12064 DefinedType.prototype.resolve = function() { | 12011 DefinedType.prototype.resolve = function() { |
| 12065 if ((this.definition instanceof TypeDefinition)) { | 12012 if ((this.definition instanceof TypeDefinition)) { |
| 12066 var typeDef = this.definition; | 12013 var typeDef = this.definition; |
| 12067 if (this.isClass) { | 12014 if (this.isClass) { |
| 12068 if (typeDef.extendsTypes != null && typeDef.extendsTypes.get$length() > (0 )) { | 12015 if (typeDef.extendsTypes != null && typeDef.extendsTypes.get$length() > (0 )) { |
| 12069 if (typeDef.extendsTypes.get$length() > (1)) { | 12016 if (typeDef.extendsTypes.get$length() > (1)) { |
| 12070 $globals.world.error("more than one base class", typeDef.extendsTypes. $index((1)).get$span()); | 12017 $globals.world.error("more than one base class", typeDef.extendsTypes[ (1)].get$span()); |
| 12071 } | 12018 } |
| 12072 var extendsTypeRef = typeDef.extendsTypes.$index((0)); | 12019 var extendsTypeRef = typeDef.extendsTypes[(0)]; |
| 12073 if ((extendsTypeRef instanceof GenericTypeReference)) { | 12020 if ((extendsTypeRef instanceof GenericTypeReference)) { |
| 12074 var g = extendsTypeRef; | 12021 var g = extendsTypeRef; |
| 12075 this.set$parent(this.resolveType(g.baseType, true)); | 12022 this.set$parent(this.resolveType$2(g.baseType, true)); |
| 12076 } | 12023 } |
| 12077 this.set$parent(this.resolveType(extendsTypeRef, true)); | 12024 this.set$parent(this.resolveType$2(extendsTypeRef, true)); |
| 12078 if (!this.get$parent().get$isClass()) { | 12025 if (!this.get$parent().get$isClass()) { |
| 12079 $globals.world.error("class may not extend an interface - use implemen ts", typeDef.extendsTypes.$index((0)).get$span()); | 12026 $globals.world.error("class may not extend an interface - use implemen ts", typeDef.extendsTypes[(0)].get$span()); |
| 12080 } | 12027 } |
| 12081 this.get$parent().addDirectSubtype(this); | 12028 this.get$parent().addDirectSubtype$1(this); |
| 12082 if (this._cycleInClassExtends()) { | 12029 if (this._cycleInClassExtends()) { |
| 12083 $globals.world.error(("class \"" + this.name + "\" has a cycle in its inheritance chain"), extendsTypeRef.get$span()); | 12030 $globals.world.error(("class \"" + this.name + "\" has a cycle in its inheritance chain"), extendsTypeRef.get$span()); |
| 12084 } | 12031 } |
| 12085 } | 12032 } |
| 12086 else { | 12033 else { |
| 12087 if (!this.get$isObject()) { | 12034 if (!this.get$isObject()) { |
| 12088 this.set$parent($globals.world.objectType); | 12035 this.set$parent($globals.world.objectType); |
| 12089 this.get$parent().addDirectSubtype(this); | 12036 this.get$parent().addDirectSubtype$1(this); |
| 12090 } | 12037 } |
| 12091 } | 12038 } |
| 12092 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); | 12039 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); |
| 12093 if (typeDef.defaultType != null) { | 12040 if (typeDef.defaultType != null) { |
| 12094 $globals.world.error("default not allowed on classes", typeDef.defaultTy pe.span); | 12041 $globals.world.error("default not allowed on classes", typeDef.defaultTy pe.span); |
| 12095 } | 12042 } |
| 12096 } | 12043 } |
| 12097 else { | 12044 else { |
| 12098 if (typeDef.implementsTypes != null && typeDef.implementsTypes.get$length( ) > (0)) { | 12045 if (typeDef.implementsTypes != null && typeDef.implementsTypes.get$length( ) > (0)) { |
| 12099 $globals.world.error("implements not allowed on interfaces (use extends) ", typeDef.implementsTypes.$index((0)).get$span()); | 12046 $globals.world.error("implements not allowed on interfaces (use extends) ", typeDef.implementsTypes[(0)].get$span()); |
| 12100 } | 12047 } |
| 12101 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); | 12048 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); |
| 12102 var res = this._cycleInInterfaceExtends(); | 12049 var res = this._cycleInInterfaceExtends(); |
| 12103 if (res >= (0)) { | 12050 if (res >= (0)) { |
| 12104 $globals.world.error(("interface \"" + this.name + "\" has a cycle in it s inheritance chain"), typeDef.extendsTypes.$index(res).get$span()); | 12051 $globals.world.error(("interface \"" + this.name + "\" has a cycle in it s inheritance chain"), typeDef.extendsTypes[res].get$span()); |
| 12105 } | 12052 } |
| 12106 if (typeDef.defaultType != null) { | 12053 if (typeDef.defaultType != null) { |
| 12107 this.defaultType = this.resolveType(typeDef.defaultType.baseType, true); | 12054 this.defaultType = this.resolveType$2(typeDef.defaultType.baseType, true ); |
| 12108 if (this.defaultType == null) { | 12055 if (this.defaultType == null) { |
| 12109 $globals.world.warning("unresolved default class", typeDef.defaultType .span); | 12056 $globals.world.warning("unresolved default class", typeDef.defaultType .span); |
| 12110 } | 12057 } |
| 12111 else { | 12058 else { |
| 12112 this.defaultType._resolveTypeParams(typeDef.defaultType.typeParameters ); | 12059 this.defaultType._resolveTypeParams(typeDef.defaultType.typeParameters ); |
| 12113 } | 12060 } |
| 12114 } | 12061 } |
| 12115 } | 12062 } |
| 12116 } | 12063 } |
| 12117 else if ((this.definition instanceof FunctionTypeDefinition)) { | 12064 else if ((this.definition instanceof FunctionTypeDefinition)) { |
| 12118 this.interfaces = [$globals.world.functionType]; | 12065 this.interfaces = [$globals.world.functionType]; |
| 12119 } | 12066 } |
| 12120 this._resolveTypeParams(this.typeParameters); | 12067 this._resolveTypeParams(this.typeParameters); |
| 12121 if (this.get$isObject()) this._createNotEqualMember(); | 12068 if (this.get$isObject()) this._createNotEqualMember(); |
| 12122 $globals.world._addType(this); | 12069 $globals.world._addType(this); |
| 12123 var $$list = this.constructors.getValues$0(); | 12070 var $$list = this.constructors.getValues(); |
| 12124 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12071 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12125 var c = $$i.next$0(); | 12072 var c = $$i.next$0(); |
| 12126 c.resolve$0(); | 12073 c.resolve$0(); |
| 12127 } | 12074 } |
| 12128 var $$list = this.members.getValues$0(); | 12075 var $$list = this.members.getValues(); |
| 12129 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12076 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12130 var m = $$i.next$0(); | 12077 var m = $$i.next$0(); |
| 12131 m.resolve$0(); | 12078 m.resolve$0(); |
| 12132 } | 12079 } |
| 12133 this.factories.forEach((function (f) { | 12080 this.factories.forEach((function (f) { |
| 12134 return f.resolve$0(); | 12081 return f.resolve$0(); |
| 12135 }) | 12082 }) |
| 12136 ); | 12083 ); |
| 12137 if (this.get$isJsGlobalObject()) { | 12084 if (this.get$isJsGlobalObject()) { |
| 12138 var $$list = this.members.getValues$0(); | 12085 var $$list = this.members.getValues(); |
| 12139 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12086 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12140 var m = $$i.next$0(); | 12087 var m = $$i.next$0(); |
| 12141 if (!m.get$isStatic()) $globals.world._addTopName(m); | 12088 if (!m.get$isStatic()) $globals.world._addTopName(m); |
| 12142 } | 12089 } |
| 12143 } | 12090 } |
| 12144 } | 12091 } |
| 12145 DefinedType.prototype._resolveTypeParams = function(params) { | 12092 DefinedType.prototype._resolveTypeParams = function(params) { |
| 12146 if (params == null) return; | 12093 if (params == null) return; |
| 12147 for (var $$i = 0;$$i < params.get$length(); $$i++) { | 12094 for (var $$i = 0;$$i < params.get$length(); $$i++) { |
| 12148 var tp = params.$index($$i); | 12095 var tp = params[$$i]; |
| 12149 tp.set$enclosingElement(this); | 12096 tp.set$enclosingElement(this); |
| 12150 tp.resolve$0(); | 12097 tp.resolve$0(); |
| 12151 } | 12098 } |
| 12152 } | 12099 } |
| 12153 DefinedType.prototype.addMethod = function(methodName, definition) { | 12100 DefinedType.prototype.addMethod = function(methodName, definition) { |
| 12154 if (methodName == null) methodName = definition.name.name; | 12101 if (methodName == null) methodName = definition.name.name; |
| 12155 var method = new MethodMember(methodName, this, definition); | 12102 var method = new MethodMember(methodName, this, definition); |
| 12156 if (method.get$isConstructor()) { | 12103 if (method.get$isConstructor()) { |
| 12157 if (this.constructors.containsKey(method.get$constructorName())) { | 12104 if (this.constructors.containsKey(method.get$constructorName())) { |
| 12158 $globals.world.error(("duplicate constructor definition of " + method.get$ name()), definition.span); | 12105 $globals.world.error(("duplicate constructor definition of " + method.get$ name()), definition.span); |
| 12159 return; | 12106 return; |
| 12160 } | 12107 } |
| 12161 this.constructors.$setindex(method.get$constructorName(), method); | 12108 this.constructors.$setindex(method.get$constructorName(), method); |
| 12162 return; | 12109 return; |
| 12163 } | 12110 } |
| 12164 if (definition.modifiers != null && definition.modifiers.get$length() == (1) & & $eq(definition.modifiers.$index((0)).get$kind(), (74))) { | 12111 if (definition.modifiers != null && definition.modifiers.get$length() == (1) & & $eq(definition.modifiers[(0)].get$kind(), (74))) { |
| 12165 if (this.factories.getFactory(method.get$constructorName(), method.get$name( )) != null) { | 12112 if (this.factories.getFactory(method.get$constructorName(), method.get$name( )) != null) { |
| 12166 $globals.world.error(("duplicate factory definition of \"" + method.get$na me() + "\""), definition.span); | 12113 $globals.world.error(("duplicate factory definition of \"" + method.get$na me() + "\""), definition.span); |
| 12167 return; | 12114 return; |
| 12168 } | 12115 } |
| 12169 this.factories.addFactory(method.get$constructorName(), method.get$name(), m ethod); | 12116 this.factories.addFactory(method.get$constructorName(), method.get$name(), m ethod); |
| 12170 return; | 12117 return; |
| 12171 } | 12118 } |
| 12172 if (methodName.startsWith("get:") || methodName.startsWith("set:")) { | 12119 if (methodName.startsWith("get:") || methodName.startsWith("set:")) { |
| 12173 var propName = methodName.substring((4)); | 12120 var propName = methodName.substring((4)); |
| 12174 var prop = this.members.$index(propName); | 12121 var prop = this.members.$index(propName); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 12196 } | 12143 } |
| 12197 if (this.members.containsKey(methodName)) { | 12144 if (this.members.containsKey(methodName)) { |
| 12198 $globals.world.error(("duplicate method definition of \"" + method.get$name( ) + "\""), definition.span); | 12145 $globals.world.error(("duplicate method definition of \"" + method.get$name( ) + "\""), definition.span); |
| 12199 return; | 12146 return; |
| 12200 } | 12147 } |
| 12201 this.members.$setindex(methodName, method); | 12148 this.members.$setindex(methodName, method); |
| 12202 } | 12149 } |
| 12203 DefinedType.prototype.addField = function(definition) { | 12150 DefinedType.prototype.addField = function(definition) { |
| 12204 for (var i = (0); | 12151 for (var i = (0); |
| 12205 i < definition.names.get$length(); i++) { | 12152 i < definition.names.get$length(); i++) { |
| 12206 var name = definition.names.$index(i).get$name(); | 12153 var name = definition.names[i].get$name(); |
| 12207 if (this.members.containsKey(name)) { | 12154 if (this.members.containsKey(name)) { |
| 12208 $globals.world.error(("duplicate field definition of \"" + name + "\""), d efinition.span); | 12155 $globals.world.error(("duplicate field definition of \"" + name + "\""), d efinition.span); |
| 12209 return; | 12156 return; |
| 12210 } | 12157 } |
| 12211 var value = null; | 12158 var value = null; |
| 12212 if (definition.values != null) { | 12159 if (definition.values != null) { |
| 12213 value = definition.values.$index(i); | 12160 value = definition.values[i]; |
| 12214 } | 12161 } |
| 12215 var field = new FieldMember(name, this, definition, value); | 12162 var field = new FieldMember(name, this, definition, value); |
| 12216 this.members.$setindex(name, field); | 12163 this.members.$setindex(name, field); |
| 12217 if (this.isNative) { | 12164 if (this.isNative) { |
| 12218 field.set$isNative(true); | 12165 field.set$isNative(true); |
| 12219 } | 12166 } |
| 12220 } | 12167 } |
| 12221 } | 12168 } |
| 12222 DefinedType.prototype.getFactory = function(type, constructorName) { | 12169 DefinedType.prototype.getFactory = function(type, constructorName) { |
| 12223 var ret = this.factories.getFactory(type.name, constructorName); | 12170 var ret = this.factories.getFactory(type.name, constructorName); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 12242 return this._tryCreateDefaultConstructor(constructorName); | 12189 return this._tryCreateDefaultConstructor(constructorName); |
| 12243 } | 12190 } |
| 12244 DefinedType.prototype._checkDefaultTypeParams = function() { | 12191 DefinedType.prototype._checkDefaultTypeParams = function() { |
| 12245 function toList(list) { | 12192 function toList(list) { |
| 12246 return (list != null ? list : const$0008); | 12193 return (list != null ? list : const$0008); |
| 12247 } | 12194 } |
| 12248 var typeDef = this.definition; | 12195 var typeDef = this.definition; |
| 12249 if (typeDef.defaultType.oldFactory) { | 12196 if (typeDef.defaultType.oldFactory) { |
| 12250 return; | 12197 return; |
| 12251 } | 12198 } |
| 12252 var interfaceParams = toList(this.typeParameters); | 12199 var interfaceParams = toList.call$1(this.typeParameters); |
| 12253 var defaultParams = toList(typeDef.defaultType.typeParameters); | 12200 var defaultParams = toList.call$1(typeDef.defaultType.typeParameters); |
| 12254 var classParams = toList(this.defaultType.typeParameters); | 12201 var classParams = toList.call$1(this.defaultType.typeParameters); |
| 12255 if ($ne(interfaceParams.get$length(), defaultParams.get$length()) || $ne(defau ltParams.get$length(), classParams.get$length())) { | 12202 if ($ne(interfaceParams.get$length(), defaultParams.get$length()) || $ne(defau ltParams.get$length(), classParams.get$length())) { |
| 12256 $globals.world.error("\"default\" must have the same number of type paramete rs as the class and interface do", this.get$span(), typeDef.defaultType.span, th is.defaultType.get$span()); | 12203 $globals.world.error("\"default\" must have the same number of type paramete rs as the class and interface do", this.get$span(), typeDef.defaultType.span, th is.defaultType.get$span()); |
| 12257 return; | 12204 return; |
| 12258 } | 12205 } |
| 12259 for (var i = (0); | 12206 for (var i = (0); |
| 12260 i < interfaceParams.get$length(); i++) { | 12207 i < interfaceParams.get$length(); i++) { |
| 12261 var ip = interfaceParams.$index(i); | 12208 var ip = interfaceParams.$index(i); |
| 12262 var dp = defaultParams.$index(i); | 12209 var dp = defaultParams.$index(i); |
| 12263 var cp = classParams.$index(i); | 12210 var cp = classParams.$index(i); |
| 12264 dp.resolve$0(); | 12211 dp.resolve$0(); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 12287 } | 12234 } |
| 12288 var typeDef = this.definition; | 12235 var typeDef = this.definition; |
| 12289 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, native_, body, span); | 12236 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, native_, body, span); |
| 12290 this.addMethod(null, c); | 12237 this.addMethod(null, c); |
| 12291 this.constructors.$index("").resolve$0(); | 12238 this.constructors.$index("").resolve$0(); |
| 12292 return this.constructors.$index(""); | 12239 return this.constructors.$index(""); |
| 12293 } | 12240 } |
| 12294 return null; | 12241 return null; |
| 12295 } | 12242 } |
| 12296 DefinedType.prototype.getMember = function(memberName) { | 12243 DefinedType.prototype.getMember = function(memberName) { |
| 12297 var member = this.members.$index(memberName); | 12244 var member = this._foundMembers.$index(memberName); |
| 12245 if (member != null) return member; | |
| 12246 member = this.members.$index(memberName); | |
| 12298 if (member != null) { | 12247 if (member != null) { |
| 12299 this._checkOverride(member); | 12248 this._checkOverride(member); |
| 12249 this._foundMembers.$setindex(memberName, member); | |
| 12300 return member; | 12250 return member; |
| 12301 } | 12251 } |
| 12302 if (this.get$isTop()) { | 12252 if (this.get$isTop()) { |
| 12303 var libType = this.library.findTypeByName(memberName); | 12253 var libType = this.library.findTypeByName(memberName); |
| 12304 if (libType != null) { | 12254 if (libType != null) { |
| 12305 return libType.get$typeMember(); | 12255 member = libType.get$typeMember(); |
| 12256 this._foundMembers.$setindex(memberName, member); | |
| 12257 return member; | |
| 12306 } | 12258 } |
| 12307 } | 12259 } |
| 12308 return this._getMemberInParents(memberName); | 12260 member = this._getMemberInParents(memberName); |
| 12261 this._foundMembers.$setindex(memberName, member); | |
| 12262 return member; | |
| 12309 } | 12263 } |
| 12310 DefinedType.prototype.resolveTypeParams = function(inType) { | 12264 DefinedType.prototype.resolveTypeParams = function(inType) { |
| 12311 return this; | 12265 return this; |
| 12312 } | 12266 } |
| 12313 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { | 12267 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 12314 var jsnames = []; | 12268 var jsnames = []; |
| 12315 var names = []; | 12269 var names = []; |
| 12316 var typeMap = new HashMapImplementation(); | 12270 var typeMap = new HashMapImplementation(); |
| 12317 for (var i = (0); | 12271 for (var i = (0); |
| 12318 i < typeArgs.get$length(); i++) { | 12272 i < typeArgs.get$length(); i++) { |
| 12319 var paramName = this.typeParameters.$index(i).get$name(); | 12273 var paramName = this.typeParameters[i].get$name(); |
| 12320 typeMap.$setindex(paramName, typeArgs.$index(i)); | 12274 typeMap.$setindex(paramName, typeArgs[i]); |
| 12321 names.add$1(typeArgs.$index(i).get$name()); | 12275 names.add$1(typeArgs[i].get$name()); |
| 12322 jsnames.add$1(typeArgs.$index(i).get$jsname()); | 12276 jsnames.add$1(typeArgs[i].get$jsname()); |
| 12323 } | 12277 } |
| 12324 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$")); | 12278 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$")); |
| 12325 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">"); | 12279 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">"); |
| 12326 var key = Strings.join(names, "$"); | 12280 var key = Strings.join(names, "$"); |
| 12327 var ret = this._concreteTypes.$index(key); | 12281 var ret = this._concreteTypes.$index(key); |
| 12328 if (ret == null) { | 12282 if (ret == null) { |
| 12329 ret = new ConcreteType(simpleName, this, typeMap, typeArgs); | 12283 ret = new ConcreteType(simpleName, this, typeMap, typeArgs); |
| 12330 ret.set$_jsname(jsname); | 12284 ret.set$_jsname(jsname); |
| 12331 this._concreteTypes.$setindex(key, ret); | 12285 this._concreteTypes.$setindex(key, ret); |
| 12332 } | 12286 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12395 } | 12349 } |
| 12396 FixedCollection.prototype.every = function(f) { | 12350 FixedCollection.prototype.every = function(f) { |
| 12397 return Collections.every(this, f); | 12351 return Collections.every(this, f); |
| 12398 } | 12352 } |
| 12399 FixedCollection.prototype.some = function(f) { | 12353 FixedCollection.prototype.some = function(f) { |
| 12400 return Collections.some(this, f); | 12354 return Collections.some(this, f); |
| 12401 } | 12355 } |
| 12402 FixedCollection.prototype.isEmpty = function() { | 12356 FixedCollection.prototype.isEmpty = function() { |
| 12403 return this.length == (0); | 12357 return this.length == (0); |
| 12404 } | 12358 } |
| 12405 FixedCollection.prototype.every$1 = function($0) { | |
| 12406 return this.every(to$call$1($0)); | |
| 12407 }; | |
| 12408 FixedCollection.prototype.filter$1 = function($0) { | 12359 FixedCollection.prototype.filter$1 = function($0) { |
| 12409 return this.filter(to$call$1($0)); | 12360 return this.filter(to$call$1($0)); |
| 12410 }; | 12361 }; |
| 12411 FixedCollection.prototype.forEach$1 = function($0) { | 12362 FixedCollection.prototype.forEach$1 = function($0) { |
| 12412 return this.forEach(to$call$1($0)); | 12363 return this.forEach(to$call$1($0)); |
| 12413 }; | 12364 }; |
| 12414 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; | 12365 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; |
| 12415 FixedCollection.prototype.iterator$0 = FixedCollection.prototype.iterator; | 12366 FixedCollection.prototype.iterator$0 = FixedCollection.prototype.iterator; |
| 12416 FixedCollection.prototype.some$1 = function($0) { | |
| 12417 return this.some(to$call$1($0)); | |
| 12418 }; | |
| 12419 // ********** Code for FixedCollection_Type ************** | 12367 // ********** Code for FixedCollection_Type ************** |
| 12420 $inherits(FixedCollection_Type, FixedCollection); | 12368 $inherits(FixedCollection_Type, FixedCollection); |
| 12421 function FixedCollection_Type(value, length) { | 12369 function FixedCollection_Type(value, length) { |
| 12422 this.value = value; | 12370 this.value = value; |
| 12423 this.length = length; | 12371 this.length = length; |
| 12424 } | 12372 } |
| 12425 // ********** Code for FixedIterator ************** | 12373 // ********** Code for FixedIterator ************** |
| 12426 function FixedIterator(value, length) { | 12374 function FixedIterator(value, length) { |
| 12427 this.length = length; | 12375 this.length = length; |
| 12428 this._index = (0); | 12376 this._index = (0); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12535 CopyOnWriteMap.prototype.containsKey = function(key) { | 12483 CopyOnWriteMap.prototype.containsKey = function(key) { |
| 12536 return this._lang_map.containsKey(key); | 12484 return this._lang_map.containsKey(key); |
| 12537 } | 12485 } |
| 12538 CopyOnWriteMap.prototype.containsKey$1 = CopyOnWriteMap.prototype.containsKey; | 12486 CopyOnWriteMap.prototype.containsKey$1 = CopyOnWriteMap.prototype.containsKey; |
| 12539 CopyOnWriteMap.prototype.forEach$1 = function($0) { | 12487 CopyOnWriteMap.prototype.forEach$1 = function($0) { |
| 12540 return this.forEach(to$call$2($0)); | 12488 return this.forEach(to$call$2($0)); |
| 12541 }; | 12489 }; |
| 12542 CopyOnWriteMap.prototype.getKeys$0 = CopyOnWriteMap.prototype.getKeys; | 12490 CopyOnWriteMap.prototype.getKeys$0 = CopyOnWriteMap.prototype.getKeys; |
| 12543 CopyOnWriteMap.prototype.getValues$0 = CopyOnWriteMap.prototype.getValues; | 12491 CopyOnWriteMap.prototype.getValues$0 = CopyOnWriteMap.prototype.getValues; |
| 12544 CopyOnWriteMap.prototype.isEmpty$0 = CopyOnWriteMap.prototype.isEmpty; | 12492 CopyOnWriteMap.prototype.isEmpty$0 = CopyOnWriteMap.prototype.isEmpty; |
| 12545 CopyOnWriteMap.prototype.putIfAbsent$2 = function($0, $1) { | |
| 12546 return this.putIfAbsent($0, to$call$0($1)); | |
| 12547 }; | |
| 12548 // ********** Code for CopyOnWriteMap_K$V ************** | 12493 // ********** Code for CopyOnWriteMap_K$V ************** |
| 12549 $inherits(CopyOnWriteMap_K$V, CopyOnWriteMap); | 12494 $inherits(CopyOnWriteMap_K$V, CopyOnWriteMap); |
| 12550 function CopyOnWriteMap_K$V() {} | 12495 function CopyOnWriteMap_K$V() {} |
| 12551 CopyOnWriteMap_K$V._wrap$ctor = function(_map) { | 12496 CopyOnWriteMap_K$V._wrap$ctor = function(_map) { |
| 12552 this._lang_map = _map; | 12497 this._lang_map = _map; |
| 12553 } | 12498 } |
| 12554 CopyOnWriteMap_K$V._wrap$ctor.prototype = CopyOnWriteMap_K$V.prototype; | 12499 CopyOnWriteMap_K$V._wrap$ctor.prototype = CopyOnWriteMap_K$V.prototype; |
| 12555 // ********** Code for CopyOnWriteMap_dart_core_String$VariableValue *********** *** | 12500 // ********** Code for CopyOnWriteMap_dart_core_String$VariableValue *********** *** |
| 12556 $inherits(CopyOnWriteMap_dart_core_String$VariableValue, CopyOnWriteMap); | 12501 $inherits(CopyOnWriteMap_dart_core_String$VariableValue, CopyOnWriteMap); |
| 12557 function CopyOnWriteMap_dart_core_String$VariableValue() { | 12502 function CopyOnWriteMap_dart_core_String$VariableValue() { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12605 } | 12550 } |
| 12606 Value.prototype.get$isFinal = function() { | 12551 Value.prototype.get$isFinal = function() { |
| 12607 return false; | 12552 return false; |
| 12608 } | 12553 } |
| 12609 Value.prototype.get$needsTemp = function() { | 12554 Value.prototype.get$needsTemp = function() { |
| 12610 return true; | 12555 return true; |
| 12611 } | 12556 } |
| 12612 Value.prototype.get$staticType = function() { | 12557 Value.prototype.get$staticType = function() { |
| 12613 return this.get$type(); | 12558 return this.get$type(); |
| 12614 } | 12559 } |
| 12560 Value.comma = function(x, y) { | |
| 12561 return new Value(y.get$type(), ("(" + x.get$code() + ", " + y.get$code() + ")" ), null); | |
| 12562 } | |
| 12615 Value.union = function(x, y) { | 12563 Value.union = function(x, y) { |
| 12616 if (y == null || $eq(x, y)) return x; | 12564 if (y == null || $eq(x, y)) return x; |
| 12617 if (x == null) return y; | 12565 if (x == null) return y; |
| 12618 var ret = x._tryUnion(y); | 12566 var ret = x._tryUnion(y); |
| 12619 if (ret != null) return ret; | 12567 if (ret != null) return ret; |
| 12620 ret = y._tryUnion(x); | 12568 ret = y._tryUnion(x); |
| 12621 if (ret != null) return ret; | 12569 if (ret != null) return ret; |
| 12622 return new Value(Type.union(x.get$type(), y.get$type()), null, null); | 12570 return new Value(Type.union(x.get$type(), y.get$type()), null, null); |
| 12623 } | 12571 } |
| 12624 Value.prototype._tryUnion = function(right) { | 12572 Value.prototype._tryUnion = function(right) { |
| 12625 return null; | 12573 return null; |
| 12626 } | 12574 } |
| 12627 Value.prototype.validateInitialized = function(span) { | 12575 Value.prototype.validateInitialized = function(span) { |
| 12628 | 12576 |
| 12629 } | 12577 } |
| 12630 Value.prototype.get_ = function(context, name, node) { | 12578 Value.prototype.get_ = function(context, name, node) { |
| 12631 var member = this._resolveMember(context, name, node, false); | 12579 var member = this._resolveMember(context, name, node, false); |
| 12632 if (member != null) { | 12580 if (member != null) { |
| 12633 return member._get$3(context, node, this); | 12581 return member._get$3(context, node, this); |
| 12634 } | 12582 } |
| 12635 else { | 12583 else { |
| 12636 return this.invokeNoSuchMethod(context, ("get:" + name), node); | 12584 return this.invokeNoSuchMethod(context, ("get:" + name), node); |
| 12637 } | 12585 } |
| 12638 } | 12586 } |
| 12639 Value.prototype.set_ = function(context, name, node, value, isDynamic) { | 12587 Value.prototype.set_ = function(context, name, node, value, isDynamic, kind, ret urnKind) { |
| 12640 var member = this._resolveMember(context, name, node, isDynamic); | 12588 var member = this._resolveMember(context, name, node, isDynamic); |
| 12641 if (member != null) { | 12589 if (member != null) { |
| 12642 return member._set$5(context, node, this, value, isDynamic); | 12590 var thisValue = this; |
| 12591 var thisTmp = null; | |
| 12592 var retTmp = null; | |
| 12593 if (kind != (0)) { | |
| 12594 thisTmp = context.getTemp(thisValue); | |
| 12595 thisValue = context.assignTemp(thisTmp, thisValue); | |
| 12596 var lhs = member._get$3(context, node, thisTmp); | |
| 12597 if (returnKind == (3)) { | |
| 12598 retTmp = context.forceTemp(lhs); | |
| 12599 lhs = context.assignTemp(retTmp, lhs); | |
| 12600 } | |
| 12601 value = lhs.binop$4(kind, value, context, node); | |
| 12602 } | |
| 12603 if (returnKind == (2)) { | |
| 12604 retTmp = context.forceTemp(value); | |
| 12605 value = context.assignTemp(retTmp, value); | |
| 12606 } | |
| 12607 var ret = member._set$5(context, node, thisValue, value, isDynamic); | |
| 12608 if (thisTmp != null && $ne(thisTmp, this)) context.freeTemp(thisTmp); | |
| 12609 if (retTmp != null) { | |
| 12610 context.freeTemp(retTmp); | |
| 12611 return Value.comma(ret, retTmp); | |
| 12612 } | |
| 12613 else { | |
| 12614 return ret; | |
| 12615 } | |
| 12643 } | 12616 } |
| 12644 else { | 12617 else { |
| 12645 return this.invokeNoSuchMethod(context, ("set:" + name), node, new Arguments (null, [value])); | 12618 return this.invokeNoSuchMethod(context, ("set:" + name), node, new Arguments (null, [value])); |
| 12646 } | 12619 } |
| 12647 } | 12620 } |
| 12621 Value.prototype.setIndex = function(context, index, node, value, isDynamic, kind , returnKind) { | |
| 12622 var member = this._resolveMember(context, ":setindex", node, isDynamic); | |
| 12623 if (member != null) { | |
| 12624 var thisValue = this; | |
| 12625 var indexValue = index; | |
| 12626 var thisTmp = null; | |
| 12627 var indexTmp = null; | |
| 12628 var retTmp = null; | |
| 12629 if (returnKind == (2)) { | |
| 12630 retTmp = context.forceTemp(value); | |
| 12631 } | |
| 12632 if (kind != (0)) { | |
| 12633 thisTmp = context.getTemp(this); | |
| 12634 indexTmp = context.getTemp(index); | |
| 12635 thisValue = context.assignTemp(thisTmp, thisValue); | |
| 12636 indexValue = context.assignTemp(indexTmp, indexValue); | |
| 12637 if (returnKind == (3)) { | |
| 12638 retTmp = context.forceTemp(value); | |
| 12639 } | |
| 12640 var lhs = thisTmp.invoke$4(context, ":index", node, new Arguments(null, [i ndexTmp])); | |
| 12641 if (returnKind == (3)) { | |
| 12642 lhs = context.assignTemp(retTmp, lhs); | |
| 12643 } | |
| 12644 value = lhs.binop$4(kind, value, context, node); | |
| 12645 } | |
| 12646 if (returnKind == (2)) { | |
| 12647 value = context.assignTemp(retTmp, value); | |
| 12648 } | |
| 12649 var ret = member.invoke$5(context, node, thisValue, new Arguments(null, [ind exValue, value]), isDynamic); | |
| 12650 if (thisTmp != null && $ne(thisTmp, this)) context.freeTemp(thisTmp); | |
| 12651 if (indexTmp != null && $ne(indexTmp, index)) context.freeTemp(indexTmp); | |
| 12652 if (retTmp != null) { | |
| 12653 context.freeTemp(retTmp); | |
| 12654 return Value.comma(ret, retTmp); | |
| 12655 } | |
| 12656 else { | |
| 12657 return ret; | |
| 12658 } | |
| 12659 } | |
| 12660 else { | |
| 12661 return this.invokeNoSuchMethod(context, ":index", node, new Arguments(null, [index, value])); | |
| 12662 } | |
| 12663 } | |
| 12648 Value.prototype.unop = function(kind, context, node) { | 12664 Value.prototype.unop = function(kind, context, node) { |
| 12649 switch (kind) { | 12665 switch (kind) { |
| 12650 case (19): | 12666 case (19): |
| 12651 | 12667 |
| 12652 var newVal = this.convertTo(context, $globals.world.nonNullBool, false); | 12668 var newVal = this.convertTo(context, $globals.world.nonNullBool, false); |
| 12653 return new Value(newVal.get$type(), ("!" + newVal.get$code()), node.get$sp an()); | 12669 return new Value(newVal.get$type(), ("!" + newVal.get$code()), node.get$sp an()); |
| 12654 | 12670 |
| 12655 case (42): | 12671 case (42): |
| 12656 | 12672 |
| 12657 $globals.world.error("no unary add operator in dart", node.get$span()); | 12673 $globals.world.error("no unary add operator in dart", node.get$span()); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12706 } | 12722 } |
| 12707 } | 12723 } |
| 12708 Value.prototype.canInvoke = function(context, name, args) { | 12724 Value.prototype.canInvoke = function(context, name, args) { |
| 12709 if (this.get$type().get$isVarOrFunction() && name == ":call") { | 12725 if (this.get$type().get$isVarOrFunction() && name == ":call") { |
| 12710 return true; | 12726 return true; |
| 12711 } | 12727 } |
| 12712 var member = this._resolveMember(context, name, null, true); | 12728 var member = this._resolveMember(context, name, null, true); |
| 12713 return member != null && member.canInvoke$2(context, args); | 12729 return member != null && member.canInvoke$2(context, args); |
| 12714 } | 12730 } |
| 12715 Value.prototype._hasOverriddenNoSuchMethod = function() { | 12731 Value.prototype._hasOverriddenNoSuchMethod = function() { |
| 12716 if (this.get$isSuper()) { | 12732 var m = this.get$type().getMember("noSuchMethod"); |
| 12717 var m = this.get$staticType().getMember("noSuchMethod"); | 12733 return m != null && !m.get$declaringType().get$isObject(); |
| 12718 return m != null && !m.get$declaringType().get$isObject(); | 12734 } |
| 12735 Value.prototype.get$isPreciseType = function() { | |
| 12736 return this.get$isSuper() || this.get$isType(); | |
| 12737 } | |
| 12738 Value.prototype._missingMemberError = function(context, name, isDynamic, node) { | |
| 12739 var onStaticType = false; | |
| 12740 if ($ne(this.get$type(), this.get$staticType())) { | |
| 12741 onStaticType = this.get$staticType().getMember(name) != null; | |
| 12742 } | |
| 12743 if (!onStaticType && !isDynamic && !this._isVarOrParameterType(this.get$static Type()) && !this._hasOverriddenNoSuchMethod()) { | |
| 12744 var typeName = this.get$staticType().name; | |
| 12745 if (typeName == null) typeName = this.get$staticType().get$library().name; | |
| 12746 var message = ("can not resolve \"" + name + "\" on \"" + typeName + "\""); | |
| 12747 if (this.get$isType()) { | |
| 12748 $globals.world.error(message, node.span); | |
| 12749 } | |
| 12750 else { | |
| 12751 $globals.world.warning(message, node.span); | |
| 12752 } | |
| 12753 } | |
| 12754 } | |
| 12755 Value.prototype._tryResolveMember = function(context, name, isDynamic, node) { | |
| 12756 var member = this.get$type().getMember(name); | |
| 12757 if (member == null) { | |
| 12758 this._missingMemberError(context, name, isDynamic, node); | |
| 12759 return null; | |
| 12719 } | 12760 } |
| 12720 else { | 12761 else { |
| 12721 var m = this.get$staticType().resolveMember("noSuchMethod"); | 12762 if (this.get$isType() && !member.get$isStatic()) { |
| 12722 return m != null && m.get$members().get$length() > (1); | 12763 if (!isDynamic) { |
| 12764 $globals.world.error("can not refer to instance member as static", node. span); | |
| 12765 } | |
| 12766 return null; | |
| 12767 } | |
| 12723 } | 12768 } |
| 12724 } | 12769 if (this.get$isPreciseType() || member.get$isStatic()) { |
| 12725 Value.prototype._tryResolveMember = function(context, resolvetype, name) { | 12770 return member.get$preciseMemberSet(); |
| 12726 if (this.get$isSuper()) { | |
| 12727 return resolvetype.getMember(name); | |
| 12728 } | 12771 } |
| 12729 else { | 12772 else { |
| 12730 return resolvetype.resolveMember(name); | 12773 return member.get$potentialMemberSet(); |
| 12731 } | 12774 } |
| 12732 } | 12775 } |
| 12733 Value.prototype._isVarOrParameterType = function(t) { | 12776 Value.prototype._isVarOrParameterType = function(t) { |
| 12734 return t.get$isVar() || (t instanceof ParameterType); | 12777 return t.get$isVar() || (t instanceof ParameterType); |
| 12735 } | 12778 } |
| 12736 Value.prototype._shouldBindDynamically = function() { | 12779 Value.prototype._shouldBindDynamically = function() { |
| 12737 return this._isVarOrParameterType(this.get$type()) || $globals.options.forceDy namic && !this.get$isConst(); | 12780 return this._isVarOrParameterType(this.get$type()) || $globals.options.forceDy namic && !this.get$isConst(); |
| 12738 } | 12781 } |
| 12739 Value.prototype._resolveMember = function(context, name, node, isDynamic) { | 12782 Value.prototype._resolveMember = function(context, name, node, isDynamic) { |
| 12740 var member; | 12783 var member = null; |
| 12741 if (!this._shouldBindDynamically()) { | 12784 if (!this._shouldBindDynamically()) { |
| 12742 member = this._tryResolveMember(context, this.get$type(), name); | 12785 member = this._tryResolveMember(context, name, isDynamic, node); |
| 12743 if (member == null && $ne(this.get$type(), this.get$staticType())) { | |
| 12744 member = this._tryResolveMember(context, this.get$staticType(), name); | |
| 12745 } | |
| 12746 if (member != null && this.get$isType() && !member.get$isStatic()) { | |
| 12747 if (!isDynamic) { | |
| 12748 $globals.world.error("can not refer to instance member as static", node. span); | |
| 12749 } | |
| 12750 return null; | |
| 12751 } | |
| 12752 if (member == null && !isDynamic && !this._isVarOrParameterType(this.get$sta ticType()) && !this._hasOverriddenNoSuchMethod()) { | |
| 12753 var typeName = this.get$staticType().name; | |
| 12754 if (typeName == null) typeName = this.get$staticType().get$library().name; | |
| 12755 var message = ("can not resolve \"" + name + "\" on \"" + typeName + "\"") ; | |
| 12756 if (this.get$isType()) { | |
| 12757 $globals.world.error(message, node.span); | |
| 12758 } | |
| 12759 else { | |
| 12760 $globals.world.warning(message, node.span); | |
| 12761 } | |
| 12762 } | |
| 12763 } | 12786 } |
| 12764 if (member == null && !this.get$isSuper() && !this.get$isType()) { | 12787 if (member == null && !this.get$isSuper() && !this.get$isType()) { |
| 12765 member = context.findMembers(name); | 12788 member = context.findMembers(name); |
| 12766 if (member == null && !isDynamic) { | 12789 if (member == null && !isDynamic) { |
| 12767 var where = "the world"; | 12790 var where = "the world"; |
| 12768 if (name.startsWith("_")) { | 12791 if (name.startsWith("_")) { |
| 12769 where = ("library \"" + context.get$library().name + "\""); | 12792 where = ("library \"" + context.get$library().name + "\""); |
| 12770 } | 12793 } |
| 12771 $globals.world.warning(("" + name + " is not defined anywhere in " + where + "."), node.span); | 12794 $globals.world.warning(("" + name + " is not defined anywhere in " + where + "."), node.span); |
| 12772 } | 12795 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12855 $globals.world.gen.corejs.useThrow = true; | 12878 $globals.world.gen.corejs.useThrow = true; |
| 12856 return ("$throw(" + result.get$code() + ")"); | 12879 return ("$throw(" + result.get$code() + ")"); |
| 12857 }) | 12880 }) |
| 12858 ); | 12881 ); |
| 12859 } | 12882 } |
| 12860 if (toType.get$isNum()) toType = $globals.world.numType; | 12883 if (toType.get$isNum()) toType = $globals.world.numType; |
| 12861 var check; | 12884 var check; |
| 12862 if (toType.get$isVoid()) { | 12885 if (toType.get$isVoid()) { |
| 12863 check = ("$assert_void(" + this.get$code() + ")"); | 12886 check = ("$assert_void(" + this.get$code() + ")"); |
| 12864 if (toType.typeCheckCode == null) { | 12887 if (toType.typeCheckCode == null) { |
| 12865 toType.typeCheckCode = ("function $assert_void(x) {\n if (x == null) retu rn null;\n " + throwTypeError("x") + "\n}"); | 12888 toType.typeCheckCode = ("function $assert_void(x) {\n if (x == null) retu rn null;\n " + throwTypeError.call$1("x") + "\n}"); |
| 12866 } | 12889 } |
| 12867 } | 12890 } |
| 12868 else if ($eq(toType, $globals.world.nonNullBool)) { | 12891 else if ($eq(toType, $globals.world.nonNullBool)) { |
| 12869 $globals.world.gen.corejs.useNotNullBool = true; | 12892 $globals.world.gen.corejs.useNotNullBool = true; |
| 12870 check = ("$notnull_bool(" + this.get$code() + ")"); | 12893 check = ("$notnull_bool(" + this.get$code() + ")"); |
| 12871 } | 12894 } |
| 12872 else if (toType.get$library().get$isCore() && toType.get$typeofName() != null) { | 12895 else if (toType.get$library().get$isCore() && toType.get$typeofName() != null) { |
| 12873 check = ("$assert_" + toType.name + "(" + this.get$code() + ")"); | 12896 check = ("$assert_" + toType.name + "(" + this.get$code() + ")"); |
| 12874 if (toType.typeCheckCode == null) { | 12897 if (toType.typeCheckCode == null) { |
| 12875 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if ( x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n " + throwTypeError("x") + "\n}"); | 12898 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if ( x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n " + throwTypeError.call$1("x") + "\n}"); |
| 12876 } | 12899 } |
| 12877 } | 12900 } |
| 12878 else { | 12901 else { |
| 12879 toType.isChecked = true; | 12902 toType.isChecked = true; |
| 12880 var checkName = "assert$" + toType.get$jsname(); | 12903 var checkName = "assert$" + toType.get$jsname(); |
| 12881 var temp = context.getTemp(this); | 12904 var temp = context.getTemp(this); |
| 12882 check = ("(" + context.assignTemp(temp, this).get$code() + " == null ? null :"); | 12905 check = ("(" + context.assignTemp(temp, this).get$code() + " == null ? null :"); |
| 12883 check = check + (" " + temp.get$code() + "." + checkName + "())"); | 12906 check = check + (" " + temp.get$code() + "." + checkName + "())"); |
| 12884 if ($ne(this, temp)) context.freeTemp(temp); | 12907 if ($ne(this, temp)) context.freeTemp(temp); |
| 12885 $globals.world.objectType.varStubs.putIfAbsent$2(checkName, (function () { | 12908 $globals.world.objectType.varStubs.putIfAbsent(checkName, (function () { |
| 12886 return new VarMethodStub(checkName, null, Arguments.get$EMPTY(), throwType Error("this")); | 12909 return new VarMethodStub(checkName, null, Arguments.get$EMPTY(), throwType Error.call$1("this")); |
| 12887 }) | 12910 }) |
| 12888 ); | 12911 ); |
| 12889 } | 12912 } |
| 12890 context.counters.typeAsserts++; | 12913 context.counters.typeAsserts++; |
| 12891 return new Value(toType, check, this.span); | 12914 return new Value(toType, check, this.span); |
| 12892 } | 12915 } |
| 12893 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck) { | 12916 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck) { |
| 12894 if (toType.get$isVar()) { | 12917 if (toType.get$isVar()) { |
| 12895 $globals.world.error("can not resolve type", span); | 12918 $globals.world.error("can not resolve type", span); |
| 12896 } | 12919 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 12932 if (!$globals.world.objectType.varStubs.containsKey(checkName)) { | 12955 if (!$globals.world.objectType.varStubs.containsKey(checkName)) { |
| 12933 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub( checkName, null, Arguments.get$EMPTY(), "return false")); | 12956 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub( checkName, null, Arguments.get$EMPTY(), "return false")); |
| 12934 } | 12957 } |
| 12935 } | 12958 } |
| 12936 return new Value($globals.world.nonNullBool, testCode, span); | 12959 return new Value($globals.world.nonNullBool, testCode, span); |
| 12937 } | 12960 } |
| 12938 Value.prototype.convertWarning = function(toType) { | 12961 Value.prototype.convertWarning = function(toType) { |
| 12939 $globals.world.warning(("type \"" + this.get$type().name + "\" is not assignab le to \"" + toType.name + "\""), this.span); | 12962 $globals.world.warning(("type \"" + this.get$type().name + "\" is not assignab le to \"" + toType.name + "\""), this.span); |
| 12940 } | 12963 } |
| 12941 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { | 12964 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { |
| 12965 if (this.get$isType()) { | |
| 12966 $globals.world.error(("member lookup failed for \"" + name + "\""), node.spa n); | |
| 12967 } | |
| 12942 var pos = ""; | 12968 var pos = ""; |
| 12943 if (args != null) { | 12969 if (args != null) { |
| 12944 var argsCode = []; | 12970 var argsCode = []; |
| 12945 for (var i = (0); | 12971 for (var i = (0); |
| 12946 i < args.get$length(); i++) { | 12972 i < args.get$length(); i++) { |
| 12947 argsCode.add$1(args.values.$index(i).get$code()); | 12973 argsCode.add$1(args.values[i].get$code()); |
| 12948 } | 12974 } |
| 12949 pos = Strings.join(argsCode, ", "); | 12975 pos = Strings.join(argsCode, ", "); |
| 12950 } | 12976 } |
| 12951 var noSuchArgs = [new Value($globals.world.stringType, ("\"" + name + "\""), n ode.span), new Value($globals.world.listType, ("[" + pos + "]"), node.span)]; | 12977 var noSuchArgs = [new Value($globals.world.stringType, ("\"" + name + "\""), n ode.span), new Value($globals.world.listType, ("[" + pos + "]"), node.span)]; |
| 12952 return this._resolveMember(context, "noSuchMethod", node, false).invoke$4(cont ext, node, this, new Arguments(null, noSuchArgs)); | 12978 return this._resolveMember(context, "noSuchMethod", node, false).invoke(contex t, node, this, new Arguments(null, noSuchArgs), false); |
| 12953 } | 12979 } |
| 12954 Value.fromBool = function(value, span) { | 12980 Value.fromBool = function(value, span) { |
| 12955 return new BoolValue(value, true, span); | 12981 return new BoolValue(value, true, span); |
| 12956 } | 12982 } |
| 12957 Value.fromInt = function(value, span) { | 12983 Value.fromInt = function(value, span) { |
| 12958 return new IntValue(value, true, span); | 12984 return new IntValue(value, true, span); |
| 12959 } | 12985 } |
| 12960 Value.fromDouble = function(value, span) { | 12986 Value.fromDouble = function(value, span) { |
| 12961 return new DoubleValue(value, true, span); | 12987 return new DoubleValue(value, true, span); |
| 12962 } | 12988 } |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 12977 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { | 13003 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { |
| 12978 return this.instanceOf($0, $1, $2, $3, false); | 13004 return this.instanceOf($0, $1, $2, $3, false); |
| 12979 }; | 13005 }; |
| 12980 Value.prototype.invoke$4 = function($0, $1, $2, $3) { | 13006 Value.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 12981 return this.invoke($0, $1, $2, $3, false); | 13007 return this.invoke($0, $1, $2, $3, false); |
| 12982 }; | 13008 }; |
| 12983 Value.prototype.invoke$4$isDynamic = Value.prototype.invoke; | 13009 Value.prototype.invoke$4$isDynamic = Value.prototype.invoke; |
| 12984 Value.prototype.invoke$5 = Value.prototype.invoke; | 13010 Value.prototype.invoke$5 = Value.prototype.invoke; |
| 12985 Value.prototype.invokeNoSuchMethod$4 = Value.prototype.invokeNoSuchMethod; | 13011 Value.prototype.invokeNoSuchMethod$4 = Value.prototype.invokeNoSuchMethod; |
| 12986 Value.prototype.needsConversion$1 = Value.prototype.needsConversion; | 13012 Value.prototype.needsConversion$1 = Value.prototype.needsConversion; |
| 12987 Value.prototype.set_$4 = function($0, $1, $2, $3) { | 13013 Value.prototype.setIndex$4$kind$returnKind = function($0, $1, $2, $3, kind, retu rnKind) { |
| 12988 return this.set_($0, $1, $2, $3, false); | 13014 return this.setIndex($0, $1, $2, $3, false, kind, returnKind); |
| 13015 }; | |
| 13016 Value.prototype.set_$4$kind$returnKind = function($0, $1, $2, $3, kind, returnKi nd) { | |
| 13017 return this.set_($0, $1, $2, $3, false, kind, returnKind); | |
| 12989 }; | 13018 }; |
| 12990 Value.prototype.unop$3 = Value.prototype.unop; | 13019 Value.prototype.unop$3 = Value.prototype.unop; |
| 12991 // ********** Code for EvaluatedValue ************** | 13020 // ********** Code for EvaluatedValue ************** |
| 12992 $inherits(EvaluatedValue, Value); | 13021 $inherits(EvaluatedValue, Value); |
| 12993 function EvaluatedValue(isConst, type, span) { | 13022 function EvaluatedValue(isConst, type, span) { |
| 12994 this.isConst = isConst; | 13023 this.isConst = isConst; |
| 12995 Value.call(this, type, "@@@", span); | 13024 Value.call(this, type, "@@@", span); |
| 12996 } | 13025 } |
| 12997 EvaluatedValue.prototype.get$isConst = function() { return this.isConst; }; | 13026 EvaluatedValue.prototype.get$isConst = function() { return this.isConst; }; |
| 12998 EvaluatedValue.prototype.get$code = function() { | 13027 EvaluatedValue.prototype.get$code = function() { |
| 12999 $globals.world.internalError("Should not be getting code from raw EvaluatedVal ue", this.span); | 13028 $globals.world.internalError("Should not be getting code from raw EvaluatedVal ue", this.span); |
| 13000 } | 13029 } |
| 13001 EvaluatedValue.prototype.get$needsTemp = function() { | 13030 EvaluatedValue.prototype.get$needsTemp = function() { |
| 13002 return false; | 13031 return false; |
| 13003 } | 13032 } |
| 13004 EvaluatedValue.prototype.hashCode = function() { | 13033 EvaluatedValue.prototype.hashCode = function() { |
| 13005 return this.get$code().hashCode(); | 13034 return this.get$code().hashCode(); |
| 13006 } | 13035 } |
| 13007 EvaluatedValue.prototype.$eq = function(other) { | 13036 EvaluatedValue.prototype.$eq = function(other) { |
| 13008 return (other instanceof EvaluatedValue) && $eq(other.get$type(), this.type) & & $eq(other.get$code(), this.get$code()); | 13037 return (other instanceof EvaluatedValue) && $eq(other.get$type(), this.get$typ e()) && $eq(other.get$code(), this.get$code()); |
| 13009 } | 13038 } |
| 13010 EvaluatedValue.prototype.hashCode$0 = EvaluatedValue.prototype.hashCode; | 13039 EvaluatedValue.prototype.hashCode$0 = EvaluatedValue.prototype.hashCode; |
| 13011 // ********** Code for NullValue ************** | 13040 // ********** Code for NullValue ************** |
| 13012 $inherits(NullValue, EvaluatedValue); | 13041 $inherits(NullValue, EvaluatedValue); |
| 13013 function NullValue(isConst, span) { | 13042 function NullValue(isConst, span) { |
| 13014 EvaluatedValue.call(this, isConst, $globals.world.varType, span); | 13043 EvaluatedValue.call(this, isConst, $globals.world.varType, span); |
| 13015 } | 13044 } |
| 13016 NullValue.prototype.get$actualValue = function() { | 13045 NullValue.prototype.get$actualValue = function() { |
| 13017 return null; | 13046 return null; |
| 13018 } | 13047 } |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13508 function ListValue(values, isConst, type, span) { | 13537 function ListValue(values, isConst, type, span) { |
| 13509 this.values = values; | 13538 this.values = values; |
| 13510 EvaluatedValue.call(this, isConst, type, span); | 13539 EvaluatedValue.call(this, isConst, type, span); |
| 13511 } | 13540 } |
| 13512 ListValue.prototype.get$code = function() { | 13541 ListValue.prototype.get$code = function() { |
| 13513 var buf = new StringBufferImpl(""); | 13542 var buf = new StringBufferImpl(""); |
| 13514 buf.add$1("["); | 13543 buf.add$1("["); |
| 13515 for (var i = (0); | 13544 for (var i = (0); |
| 13516 i < this.values.get$length(); i = $add(i, (1))) { | 13545 i < this.values.get$length(); i = $add(i, (1))) { |
| 13517 if (i > (0)) buf.add$1(", "); | 13546 if (i > (0)) buf.add$1(", "); |
| 13518 buf.add$1(this.values.$index(i).get$code()); | 13547 buf.add$1(this.values[i].get$code()); |
| 13519 } | 13548 } |
| 13520 buf.add$1("]"); | 13549 buf.add$1("]"); |
| 13521 var listCode = buf.toString$0(); | 13550 var listCode = buf.toString$0(); |
| 13522 if (!this.isConst) return listCode; | 13551 if (!this.isConst) return listCode; |
| 13523 var v = new Value($globals.world.listType, listCode, this.span); | 13552 var v = new Value($globals.world.listType, listCode, this.span); |
| 13524 var immutableListCtor = $globals.world.immutableListType.getConstructor("from" ); | 13553 var immutableListCtor = $globals.world.immutableListType.getConstructor("from" ); |
| 13525 var result = immutableListCtor.invoke$4(null, null, new TypeValue(v.get$type() , this.span), new Arguments(null, [v])); | 13554 var result = immutableListCtor.invoke$4(null, null, new TypeValue(v.get$type() , this.span), new Arguments(null, [v])); |
| 13526 return result.get$code(); | 13555 return result.get$code(); |
| 13527 } | 13556 } |
| 13528 ListValue.prototype.binop = function(kind, other, context, node) { | 13557 ListValue.prototype.binop = function(kind, other, context, node) { |
| 13529 if (!(other instanceof ListValue)) return Value.prototype.binop.call(this, kin d, other, context, node); | 13558 if (!(other instanceof ListValue)) return Value.prototype.binop.call(this, kin d, other, context, node); |
| 13530 switch (kind) { | 13559 switch (kind) { |
| 13531 case (50): | 13560 case (50): |
| 13532 | 13561 |
| 13533 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() = = other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13562 return new BoolValue($eq(this.get$type(), other.get$type()) && this.get$co de() == other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13534 | 13563 |
| 13535 case (51): | 13564 case (51): |
| 13536 | 13565 |
| 13537 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() ! = other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13566 return new BoolValue($ne(this.get$type(), other.get$type()) || this.get$co de() != other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13538 | 13567 |
| 13539 } | 13568 } |
| 13540 return Value.prototype.binop.call(this, kind, other, context, node); | 13569 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13541 } | 13570 } |
| 13542 ListValue.prototype.getGlobalValue = function() { | 13571 ListValue.prototype.getGlobalValue = function() { |
| 13543 return $globals.world.gen.globalForConst(this, this.values); | 13572 return $globals.world.gen.globalForConst(this, this.values); |
| 13544 } | 13573 } |
| 13545 ListValue.prototype.binop$4 = ListValue.prototype.binop; | 13574 ListValue.prototype.binop$4 = ListValue.prototype.binop; |
| 13546 ListValue.prototype.getGlobalValue$0 = ListValue.prototype.getGlobalValue; | 13575 ListValue.prototype.getGlobalValue$0 = ListValue.prototype.getGlobalValue; |
| 13547 // ********** Code for MapValue ************** | 13576 // ********** Code for MapValue ************** |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 13558 return value.get$code(); | 13587 return value.get$code(); |
| 13559 } | 13588 } |
| 13560 MapValue.prototype.getGlobalValue = function() { | 13589 MapValue.prototype.getGlobalValue = function() { |
| 13561 return $globals.world.gen.globalForConst(this, this.values); | 13590 return $globals.world.gen.globalForConst(this, this.values); |
| 13562 } | 13591 } |
| 13563 MapValue.prototype.binop = function(kind, other, context, node) { | 13592 MapValue.prototype.binop = function(kind, other, context, node) { |
| 13564 if (!(other instanceof MapValue)) return Value.prototype.binop.call(this, kind , other, context, node); | 13593 if (!(other instanceof MapValue)) return Value.prototype.binop.call(this, kind , other, context, node); |
| 13565 switch (kind) { | 13594 switch (kind) { |
| 13566 case (50): | 13595 case (50): |
| 13567 | 13596 |
| 13568 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() = = other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13597 return new BoolValue($eq(this.get$type(), other.get$type()) && this.get$co de() == other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13569 | 13598 |
| 13570 case (51): | 13599 case (51): |
| 13571 | 13600 |
| 13572 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() ! = other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13601 return new BoolValue($ne(this.get$type(), other.get$type()) || this.get$co de() != other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13573 | 13602 |
| 13574 } | 13603 } |
| 13575 return Value.prototype.binop.call(this, kind, other, context, node); | 13604 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13576 } | 13605 } |
| 13577 MapValue.prototype.binop$4 = MapValue.prototype.binop; | 13606 MapValue.prototype.binop$4 = MapValue.prototype.binop; |
| 13578 MapValue.prototype.getGlobalValue$0 = MapValue.prototype.getGlobalValue; | 13607 MapValue.prototype.getGlobalValue$0 = MapValue.prototype.getGlobalValue; |
| 13579 // ********** Code for ObjectValue ************** | 13608 // ********** Code for ObjectValue ************** |
| 13580 $inherits(ObjectValue, EvaluatedValue); | 13609 $inherits(ObjectValue, EvaluatedValue); |
| 13581 function ObjectValue(isConst, type, span) { | 13610 function ObjectValue(isConst, type, span) { |
| 13582 this.seenNativeInitializer = false; | 13611 this.seenNativeInitializer = false; |
| 13583 this.fields = new HashMapImplementation(); | 13612 this.fields = new HashMapImplementation(); |
| 13584 EvaluatedValue.call(this, isConst, type, span); | 13613 EvaluatedValue.call(this, isConst, type, span); |
| 13585 } | 13614 } |
| 13586 ObjectValue.prototype.get$fields = function() { return this.fields; }; | 13615 ObjectValue.prototype.get$fields = function() { return this.fields; }; |
| 13587 ObjectValue.prototype.get$seenNativeInitializer = function() { return this.seenN ativeInitializer; }; | 13616 ObjectValue.prototype.get$seenNativeInitializer = function() { return this.seenN ativeInitializer; }; |
| 13588 ObjectValue.prototype.set$seenNativeInitializer = function(value) { return this. seenNativeInitializer = value; }; | 13617 ObjectValue.prototype.set$seenNativeInitializer = function(value) { return this. seenNativeInitializer = value; }; |
| 13589 ObjectValue.prototype.get$code = function() { | 13618 ObjectValue.prototype.get$code = function() { |
| 13590 if (this._code == null) this.validateInitialized(null); | 13619 if (this._code == null) this.validateInitialized(null); |
| 13591 return this._code; | 13620 return this._code; |
| 13592 } | 13621 } |
| 13593 ObjectValue.prototype.initFields = function() { | 13622 ObjectValue.prototype.initFields = function() { |
| 13594 var allMembers = $globals.world.gen._orderValues(this.type.getAllMembers()); | 13623 var allMembers = $globals.world.gen._orderValues(this.get$type().getAllMembers ()); |
| 13595 for (var $$i = allMembers.iterator$0(); $$i.hasNext$0(); ) { | 13624 for (var $$i = allMembers.iterator$0(); $$i.hasNext$0(); ) { |
| 13596 var f = $$i.next$0(); | 13625 var f = $$i.next$0(); |
| 13597 if (f.get$isField() && !f.get$isStatic() && f.get$declaringType().get$isClas s()) { | 13626 if (f.get$isField() && !f.get$isStatic() && f.get$declaringType().get$isClas s()) { |
| 13598 this.fields.$setindex(f, f.computeValue$0()); | 13627 this.fields.$setindex(f, f.computeValue$0()); |
| 13599 } | 13628 } |
| 13600 } | 13629 } |
| 13601 } | 13630 } |
| 13602 ObjectValue.prototype.setField = function(field, value, duringInit) { | 13631 ObjectValue.prototype.setField = function(field, value, duringInit) { |
| 13603 if (value.get$isConst() && (value instanceof VariableValue)) { | 13632 if (value.get$isConst() && (value instanceof VariableValue)) { |
| 13604 value = value.get$dynamic().get$value(); | 13633 value = value.get$dynamic().get$value(); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 13618 $globals.world.error("reassignment of field not allowed", value.span, fiel d.get$span()); | 13647 $globals.world.error("reassignment of field not allowed", value.span, fiel d.get$span()); |
| 13619 } | 13648 } |
| 13620 else { | 13649 else { |
| 13621 this.fields.$setindex(field, value); | 13650 this.fields.$setindex(field, value); |
| 13622 } | 13651 } |
| 13623 } | 13652 } |
| 13624 } | 13653 } |
| 13625 ObjectValue.prototype.validateInitialized = function(span) { | 13654 ObjectValue.prototype.validateInitialized = function(span) { |
| 13626 var buf = new StringBufferImpl(""); | 13655 var buf = new StringBufferImpl(""); |
| 13627 buf.add$1("Object.create("); | 13656 buf.add$1("Object.create("); |
| 13628 buf.add$1(("" + this.type.get$jsname() + ".prototype, ")); | 13657 buf.add$1(("" + this.get$type().get$jsname() + ".prototype, ")); |
| 13629 buf.add$1("{"); | 13658 buf.add$1("{"); |
| 13630 var $$list = this.fields.getKeys$0(); | 13659 var $$list = this.fields.getKeys(); |
| 13631 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 13660 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 13632 var field = $$i.next$0(); | 13661 var field = $$i.next$0(); |
| 13633 buf.add$1(field.get$name()); | 13662 buf.add$1(field.get$name()); |
| 13634 buf.add$1(": "); | 13663 buf.add$1(": "); |
| 13635 buf.add$1("{\"value\": "); | 13664 buf.add$1("{\"value\": "); |
| 13636 if (this.fields.$index(field) == null) { | 13665 if (this.fields.$index(field) == null) { |
| 13637 $globals.world.error(("Required field \"" + field.get$name() + "\" was not initialized"), span, field.get$span()); | 13666 $globals.world.error(("Required field \"" + field.get$name() + "\" was not initialized"), span, field.get$span()); |
| 13638 buf.add$1("null"); | 13667 buf.add$1("null"); |
| 13639 } | 13668 } |
| 13640 else { | 13669 else { |
| 13641 buf.add$1(this.fields.$index(field).get$code()); | 13670 buf.add$1(this.fields.$index(field).get$code()); |
| 13642 } | 13671 } |
| 13643 buf.add$1(", writeable: false}, "); | 13672 buf.add$1(", writeable: false}, "); |
| 13644 } | 13673 } |
| 13645 buf.add$1("})"); | 13674 buf.add$1("})"); |
| 13646 this._code = buf.toString$0(); | 13675 this._code = buf.toString$0(); |
| 13647 } | 13676 } |
| 13648 ObjectValue.prototype.binop = function(kind, other, context, node) { | 13677 ObjectValue.prototype.binop = function(kind, other, context, node) { |
| 13649 if (!(other instanceof ObjectValue)) return Value.prototype.binop.call(this, k ind, other, context, node); | 13678 if (!(other instanceof ObjectValue)) return Value.prototype.binop.call(this, k ind, other, context, node); |
| 13650 switch (kind) { | 13679 switch (kind) { |
| 13651 case (50): | 13680 case (50): |
| 13652 case (48): | 13681 case (48): |
| 13653 | 13682 |
| 13654 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() = = other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13683 return new BoolValue($eq(this.get$type(), other.get$type()) && this.get$co de() == other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13655 | 13684 |
| 13656 case (51): | 13685 case (51): |
| 13657 case (49): | 13686 case (49): |
| 13658 | 13687 |
| 13659 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() ! = other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13688 return new BoolValue($ne(this.get$type(), other.get$type()) || this.get$co de() != other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13660 | 13689 |
| 13661 } | 13690 } |
| 13662 return Value.prototype.binop.call(this, kind, other, context, node); | 13691 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13663 } | 13692 } |
| 13664 ObjectValue.prototype.binop$4 = ObjectValue.prototype.binop; | 13693 ObjectValue.prototype.binop$4 = ObjectValue.prototype.binop; |
| 13665 ObjectValue.prototype.initFields$0 = ObjectValue.prototype.initFields; | 13694 ObjectValue.prototype.initFields$0 = ObjectValue.prototype.initFields; |
| 13666 // ********** Code for GlobalValue ************** | 13695 // ********** Code for GlobalValue ************** |
| 13667 $inherits(GlobalValue, Value); | 13696 $inherits(GlobalValue, Value); |
| 13668 function GlobalValue(type, code, isConst, field, name, exp, span, deps) { | 13697 function GlobalValue(type, code, isConst, field, name, exp, span, deps) { |
| 13669 this.exp = exp; | 13698 this.exp = exp; |
| 13670 this.field = field; | 13699 this.field = field; |
| 13671 this.name = name; | 13700 this.name = name; |
| 13672 this.dependencies = []; | 13701 this.dependencies = []; |
| 13673 this.isConst = isConst; | 13702 this.isConst = isConst; |
| 13674 Value.call(this, type, code, span); | 13703 Value.call(this, type, code, span); |
| 13675 for (var $$i = 0;$$i < deps.get$length(); $$i++) { | 13704 for (var $$i = 0;$$i < deps.get$length(); $$i++) { |
| 13676 var dep = deps.$index($$i); | 13705 var dep = deps[$$i]; |
| 13677 if ((dep instanceof GlobalValue)) { | 13706 if ((dep instanceof GlobalValue)) { |
| 13678 this.dependencies.add(dep); | 13707 this.dependencies.add(dep); |
| 13679 this.dependencies.addAll(dep.get$dependencies()); | 13708 this.dependencies.addAll(dep.get$dependencies()); |
| 13680 } | 13709 } |
| 13681 } | 13710 } |
| 13682 } | 13711 } |
| 13683 GlobalValue.prototype.get$field = function() { return this.field; }; | 13712 GlobalValue.prototype.get$field = function() { return this.field; }; |
| 13684 GlobalValue.prototype.get$name = function() { return this.name; }; | 13713 GlobalValue.prototype.get$name = function() { return this.name; }; |
| 13685 GlobalValue.prototype.get$exp = function() { return this.exp; }; | 13714 GlobalValue.prototype.get$exp = function() { return this.exp; }; |
| 13686 GlobalValue.prototype.get$isConst = function() { return this.isConst; }; | 13715 GlobalValue.prototype.get$isConst = function() { return this.isConst; }; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13732 BareValue.prototype.get$needsTemp = function() { | 13761 BareValue.prototype.get$needsTemp = function() { |
| 13733 return false; | 13762 return false; |
| 13734 } | 13763 } |
| 13735 BareValue.prototype._shouldBindDynamically = function() { | 13764 BareValue.prototype._shouldBindDynamically = function() { |
| 13736 return false; | 13765 return false; |
| 13737 } | 13766 } |
| 13738 BareValue.prototype.get$code = function() { | 13767 BareValue.prototype.get$code = function() { |
| 13739 return this._code; | 13768 return this._code; |
| 13740 } | 13769 } |
| 13741 BareValue.prototype._ensureCode = function() { | 13770 BareValue.prototype._ensureCode = function() { |
| 13742 if (this._code == null) this._code = this.isType ? this.type.get$jsname() : th is.home._makeThisCode(); | 13771 if (this._code == null) this._code = this.isType ? this.get$type().get$jsname( ) : this.home._makeThisCode(); |
| 13743 } | 13772 } |
| 13744 BareValue.prototype._tryResolveMember = function(context, resolveType, name) { | 13773 BareValue.prototype._tryResolveMember = function(context, name, isDynamic, node) { |
| 13745 var member = resolveType.resolveMember(name); | 13774 var member = this.get$type().getMember(name); |
| 13746 if (member != null) { | 13775 if (member == null || $ne(member.get$declaringType(), this.get$type())) { |
| 13747 if ($globals.options.forceDynamic && !member.get$isStatic()) { | 13776 var libMember = this.home.get$library().lookup(name, this.span); |
| 13748 member = context.findMembers(name); | 13777 if (libMember != null) { |
| 13778 return libMember.get$preciseMemberSet(); | |
| 13749 } | 13779 } |
| 13750 this._ensureCode(); | |
| 13751 return member; | |
| 13752 } | |
| 13753 member = this.home.get$library().lookup(name, this.span); | |
| 13754 if (member != null) { | |
| 13755 return member; | |
| 13756 } | 13780 } |
| 13757 this._ensureCode(); | 13781 this._ensureCode(); |
| 13758 return null; | 13782 return Value.prototype._tryResolveMember.call(this, context, name, isDynamic, node); |
| 13759 } | 13783 } |
| 13760 // ********** Code for SuperValue ************** | 13784 // ********** Code for SuperValue ************** |
| 13761 $inherits(SuperValue, Value); | 13785 $inherits(SuperValue, Value); |
| 13762 function SuperValue(parentType, span) { | 13786 function SuperValue(parentType, span) { |
| 13763 Value.call(this, parentType, "this", span); | 13787 Value.call(this, parentType, "this", span); |
| 13764 } | 13788 } |
| 13765 SuperValue.prototype.get$needsTemp = function() { | 13789 SuperValue.prototype.get$needsTemp = function() { |
| 13766 return false; | 13790 return false; |
| 13767 } | 13791 } |
| 13768 SuperValue.prototype.get$isSuper = function() { | 13792 SuperValue.prototype.get$isSuper = function() { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13854 VariableValue.prototype.get$type = function() { | 13878 VariableValue.prototype.get$type = function() { |
| 13855 return this.value != null ? this.value.get$type() : this.get$staticType(); | 13879 return this.value != null ? this.value.get$type() : this.get$staticType(); |
| 13856 } | 13880 } |
| 13857 VariableValue.prototype.get$staticType = function() { | 13881 VariableValue.prototype.get$staticType = function() { |
| 13858 return this.type; | 13882 return this.type; |
| 13859 } | 13883 } |
| 13860 VariableValue.prototype.get$isConst = function() { | 13884 VariableValue.prototype.get$isConst = function() { |
| 13861 return this.value != null ? this.value.get$isConst() : false; | 13885 return this.value != null ? this.value.get$isConst() : false; |
| 13862 } | 13886 } |
| 13863 VariableValue.prototype.replaceValue = function(v) { | 13887 VariableValue.prototype.replaceValue = function(v) { |
| 13864 return new VariableValue(this.get$staticType(), this.code, this.span, this.isF inal, v); | 13888 return new VariableValue(this.get$staticType(), this.get$code(), this.span, th is.isFinal, v); |
| 13865 } | 13889 } |
| 13866 VariableValue.prototype.unop = function(kind, context, node) { | 13890 VariableValue.prototype.unop = function(kind, context, node) { |
| 13867 if (this.value != null) { | 13891 if (this.value != null) { |
| 13868 return this.replaceValue(this.value.unop(kind, context, node)); | 13892 return this.replaceValue(this.value.unop(kind, context, node)); |
| 13869 } | 13893 } |
| 13870 return Value.prototype.unop.call(this, kind, context, node); | 13894 return Value.prototype.unop.call(this, kind, context, node); |
| 13871 } | 13895 } |
| 13872 VariableValue.prototype.binop = function(kind, other, context, node) { | 13896 VariableValue.prototype.binop = function(kind, other, context, node) { |
| 13873 if (this.value != null) { | 13897 if (this.value != null) { |
| 13874 return this.replaceValue(this.value.binop(kind, VariableValue._unwrap(other) , context, node)); | 13898 return this.replaceValue(this.value.binop(kind, VariableValue._unwrap(other) , context, node)); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 13887 if (this._location != null) { | 13911 if (this._location != null) { |
| 13888 return ("CompilerException: " + this._location.toMessageString(this._lang_me ssage)); | 13912 return ("CompilerException: " + this._location.toMessageString(this._lang_me ssage)); |
| 13889 } | 13913 } |
| 13890 else { | 13914 else { |
| 13891 return ("CompilerException: " + this._lang_message); | 13915 return ("CompilerException: " + this._lang_message); |
| 13892 } | 13916 } |
| 13893 } | 13917 } |
| 13894 CompilerException.prototype.toString$0 = CompilerException.prototype.toString; | 13918 CompilerException.prototype.toString$0 = CompilerException.prototype.toString; |
| 13895 // ********** Code for CounterLog ************** | 13919 // ********** Code for CounterLog ************** |
| 13896 function CounterLog() { | 13920 function CounterLog() { |
| 13921 this.msetN = (0); | |
| 13897 this.objectProtoMembers = (0); | 13922 this.objectProtoMembers = (0); |
| 13898 this.dynamicMethodCalls = (0); | 13923 this.dynamicMethodCalls = (0); |
| 13899 this.typeAsserts = (0); | 13924 this.typeAsserts = (0); |
| 13925 this.invokeCalls = (0); | |
| 13900 } | 13926 } |
| 13901 CounterLog.prototype.info = function() { | 13927 CounterLog.prototype.info = function() { |
| 13902 $globals.world.info(("Dynamically typed method calls: " + this.dynamicMethodCa lls)); | 13928 $globals.world.info(("Dynamically typed method calls: " + this.dynamicMethodCa lls)); |
| 13903 $globals.world.info(("Generated type assertions: " + this.typeAsserts)); | 13929 $globals.world.info(("Generated type assertions: " + this.typeAsserts)); |
| 13904 $globals.world.info(("Members on Object.prototype: " + this.objectProtoMembers )); | 13930 $globals.world.info(("Members on Object.prototype: " + this.objectProtoMembers )); |
| 13931 $globals.world.info(("Invoke calls: " + this.invokeCalls)); | |
| 13932 $globals.world.info(("msetN calls: " + this.msetN)); | |
| 13905 } | 13933 } |
| 13906 CounterLog.prototype.add = function(other) { | 13934 CounterLog.prototype.add = function(other) { |
| 13907 this.dynamicMethodCalls += other.dynamicMethodCalls; | 13935 this.dynamicMethodCalls = this.dynamicMethodCalls + other.dynamicMethodCalls; |
| 13908 this.typeAsserts += other.typeAsserts; | 13936 this.typeAsserts = this.typeAsserts + other.typeAsserts; |
| 13909 this.objectProtoMembers += other.objectProtoMembers; | 13937 this.objectProtoMembers = this.objectProtoMembers + other.objectProtoMembers; |
| 13938 this.invokeCalls = this.invokeCalls + other.invokeCalls; | |
| 13939 this.msetN = this.msetN + other.msetN; | |
| 13910 } | 13940 } |
| 13911 CounterLog.prototype.add$1 = CounterLog.prototype.add; | 13941 CounterLog.prototype.add$1 = CounterLog.prototype.add; |
| 13912 // ********** Code for World ************** | 13942 // ********** Code for World ************** |
| 13913 function World(files) { | 13943 function World(files) { |
| 13914 this.files = files; | 13944 this.files = files; |
| 13915 this._members = new HashMapImplementation(); | 13945 this._members = new HashMapImplementation(); |
| 13916 this._topNames = new HashMapImplementation(); | 13946 this._topNames = new HashMapImplementation(); |
| 13917 this.warnings = (0); | 13947 this.warnings = (0); |
| 13918 this.seenFatal = false; | 13948 this.seenFatal = false; |
| 13919 this.libraries = new HashMapImplementation(); | 13949 this.libraries = new HashMapImplementation(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14062 this.printStatus(); | 14092 this.printStatus(); |
| 14063 return !this.get$hasErrors(); | 14093 return !this.get$hasErrors(); |
| 14064 } | 14094 } |
| 14065 World.prototype.runLeg = function() { | 14095 World.prototype.runLeg = function() { |
| 14066 var $this = this; // closure support | 14096 var $this = this; // closure support |
| 14067 if (!$globals.options.enableLeg) return false; | 14097 if (!$globals.options.enableLeg) return false; |
| 14068 if ($globals.legCompile == null) { | 14098 if ($globals.legCompile == null) { |
| 14069 this.fatal("requested leg enabled, but no leg compiler available"); | 14099 this.fatal("requested leg enabled, but no leg compiler available"); |
| 14070 } | 14100 } |
| 14071 var res = this.withTiming("try leg compile", (function () { | 14101 var res = this.withTiming("try leg compile", (function () { |
| 14072 return $globals.legCompile($this); | 14102 return $globals.legCompile.call$1($this); |
| 14073 }) | 14103 }) |
| 14074 ); | 14104 ); |
| 14075 if (!res && $globals.options.legOnly) { | 14105 if (!res && $globals.options.legOnly) { |
| 14076 this.fatal(("Leg could not compile " + $globals.options.dartScript)); | 14106 this.fatal(("Leg could not compile " + $globals.options.dartScript)); |
| 14077 return true; | 14107 return true; |
| 14078 } | 14108 } |
| 14079 return res; | 14109 return res; |
| 14080 } | 14110 } |
| 14081 World.prototype.runCompilationPhases = function() { | 14111 World.prototype.runCompilationPhases = function() { |
| 14082 var $this = this; // closure support | 14112 var $this = this; // closure support |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14141 } | 14171 } |
| 14142 } | 14172 } |
| 14143 } | 14173 } |
| 14144 World.prototype.processDartScript = function(script) { | 14174 World.prototype.processDartScript = function(script) { |
| 14145 if (script == null) script = $globals.options.dartScript; | 14175 if (script == null) script = $globals.options.dartScript; |
| 14146 var library = this.getOrAddLibrary(script); | 14176 var library = this.getOrAddLibrary(script); |
| 14147 this.process(); | 14177 this.process(); |
| 14148 return library; | 14178 return library; |
| 14149 } | 14179 } |
| 14150 World.prototype.resolveAll = function() { | 14180 World.prototype.resolveAll = function() { |
| 14151 var $$list = this.libraries.getValues$0(); | 14181 var $$list = this.libraries.getValues(); |
| 14152 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 14182 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 14153 var lib = $$i.next$0(); | 14183 var lib = $$i.next$0(); |
| 14154 lib.resolve$0(); | 14184 lib.resolve$0(); |
| 14155 } | 14185 } |
| 14156 var $$list = this.libraries.getValues$0(); | 14186 var $$list = this.libraries.getValues(); |
| 14157 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 14187 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 14158 var lib = $$i.next$0(); | 14188 var lib = $$i.next$0(); |
| 14159 lib.postResolveChecks$0(); | 14189 lib.postResolveChecks$0(); |
| 14160 } | 14190 } |
| 14161 } | 14191 } |
| 14162 World.prototype.get$resolveAll = function() { | 14192 World.prototype.get$resolveAll = function() { |
| 14163 return this.resolveAll.bind(this); | 14193 return this.resolveAll.bind(this); |
| 14164 } | 14194 } |
| 14165 World.prototype.findMainMethod = function(lib) { | 14195 World.prototype.findMainMethod = function(lib) { |
| 14166 var mainMembers = lib.topType.resolveMember("main"); | 14196 var main = lib.lookup("main", lib.get$span()); |
| 14167 var main = null; | 14197 if (main == null) { |
| 14168 if (mainMembers == null || $eq(mainMembers.get$members().get$length(), (0))) { | |
| 14169 this.fatal("no main method specified"); | 14198 this.fatal("no main method specified"); |
| 14170 } | 14199 } |
| 14171 else if (mainMembers.get$members().get$length() > (1)) { | |
| 14172 var $$list = mainMembers.get$members(); | |
| 14173 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | |
| 14174 var m = $$i.next$0(); | |
| 14175 main = m; | |
| 14176 this.error("more than one main member (using last?)", main.get$span()); | |
| 14177 } | |
| 14178 } | |
| 14179 else { | |
| 14180 main = mainMembers.get$members().$index((0)); | |
| 14181 } | |
| 14182 return main; | 14200 return main; |
| 14183 } | 14201 } |
| 14184 World.prototype.generateCode = function(lib) { | 14202 World.prototype.generateCode = function(lib) { |
| 14185 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); | 14203 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); |
| 14186 this.gen.run(); | 14204 this.gen.run(); |
| 14187 this.frogCode = this.gen.writer.get$text(); | 14205 this.frogCode = this.gen.writer.get$text(); |
| 14188 this.jsBytesWritten = this.frogCode.length; | 14206 this.jsBytesWritten = this.frogCode.length; |
| 14189 this.gen = null; | 14207 this.gen = null; |
| 14190 } | 14208 } |
| 14191 World.prototype._message = function(color, prefix, message, span, span1, span2, throwing) { | 14209 World.prototype._message = function(color, prefix, message, span, span1, span2, throwing) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14240 } | 14258 } |
| 14241 World.prototype.info = function(message, span, span1, span2) { | 14259 World.prototype.info = function(message, span, span1, span2) { |
| 14242 if ($globals.options.showInfo) { | 14260 if ($globals.options.showInfo) { |
| 14243 this._message($globals._GREEN_COLOR, "info: ", message, span, span1, span2, false); | 14261 this._message($globals._GREEN_COLOR, "info: ", message, span, span1, span2, false); |
| 14244 } | 14262 } |
| 14245 } | 14263 } |
| 14246 World.prototype.withoutForceDynamic = function(fn) { | 14264 World.prototype.withoutForceDynamic = function(fn) { |
| 14247 var oldForceDynamic = $globals.options.forceDynamic; | 14265 var oldForceDynamic = $globals.options.forceDynamic; |
| 14248 $globals.options.forceDynamic = false; | 14266 $globals.options.forceDynamic = false; |
| 14249 try { | 14267 try { |
| 14250 return fn(); | 14268 return fn.call$0(); |
| 14251 } finally { | 14269 } finally { |
| 14252 $globals.options.forceDynamic = oldForceDynamic; | 14270 $globals.options.forceDynamic = oldForceDynamic; |
| 14253 } | 14271 } |
| 14254 } | 14272 } |
| 14255 World.prototype.get$hasErrors = function() { | 14273 World.prototype.get$hasErrors = function() { |
| 14256 return this.errors > (0); | 14274 return this.errors > (0); |
| 14257 } | 14275 } |
| 14258 World.prototype.printStatus = function() { | 14276 World.prototype.printStatus = function() { |
| 14259 this.counters.info(); | 14277 this.counters.info(); |
| 14260 this.info(("compiled " + this.dartBytesRead + " bytes Dart -> " + this.jsBytes Written + " bytes JS")); | 14278 this.info(("compiled " + this.dartBytesRead + " bytes Dart -> " + this.jsBytes Written + " bytes JS")); |
| 14261 if (this.get$hasErrors()) { | 14279 if (this.get$hasErrors()) { |
| 14262 print(("compilation failed with " + this.errors + " errors")); | 14280 print(("compilation failed with " + this.errors + " errors")); |
| 14263 } | 14281 } |
| 14264 else { | 14282 else { |
| 14265 if (this.warnings > (0)) { | 14283 if (this.warnings > (0)) { |
| 14266 this.info(("compilation completed successfully with " + this.warnings + " warnings")); | 14284 this.info(("compilation completed successfully with " + this.warnings + " warnings")); |
| 14267 } | 14285 } |
| 14268 else { | 14286 else { |
| 14269 this.info("compilation completed sucessfully"); | 14287 this.info("compilation completed sucessfully"); |
| 14270 } | 14288 } |
| 14271 } | 14289 } |
| 14272 } | 14290 } |
| 14273 World.prototype.withTiming = function(name, f) { | 14291 World.prototype.withTiming = function(name, f) { |
| 14274 var sw = new StopwatchImplementation(); | 14292 var sw = new StopwatchImplementation(); |
| 14275 sw.start$0(); | 14293 sw.start$0(); |
| 14276 var result = f(); | 14294 var result = f.call$0(); |
| 14277 sw.stop$0(); | 14295 sw.stop$0(); |
| 14278 this.info(("" + name + " in " + sw.elapsedInMs$0() + "msec")); | 14296 this.info(("" + name + " in " + sw.elapsedInMs$0() + "msec")); |
| 14279 return result; | 14297 return result; |
| 14280 } | 14298 } |
| 14281 // ********** Code for FrogOptions ************** | 14299 // ********** Code for FrogOptions ************** |
| 14282 function FrogOptions(homedir, args, files) { | 14300 function FrogOptions(homedir, args, files) { |
| 14283 this.legOnly = false; | 14301 this.legOnly = false; |
| 14284 this.throwOnFatal = false; | 14302 this.throwOnFatal = false; |
| 14285 this.maxInferenceIterations = (4); | 14303 this.maxInferenceIterations = (4); |
| 14286 this.config = "dev"; | 14304 this.config = "dev"; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 14308 else { | 14326 else { |
| 14309 $globals.world.error(("Invalid configuration " + this.config)); | 14327 $globals.world.error(("Invalid configuration " + this.config)); |
| 14310 $throw("Invalid configuration"); | 14328 $throw("Invalid configuration"); |
| 14311 } | 14329 } |
| 14312 var ignoreUnrecognizedFlags = false; | 14330 var ignoreUnrecognizedFlags = false; |
| 14313 var passedLibDir = false; | 14331 var passedLibDir = false; |
| 14314 this.childArgs = []; | 14332 this.childArgs = []; |
| 14315 loop: | 14333 loop: |
| 14316 for (var i = (2); | 14334 for (var i = (2); |
| 14317 i < args.get$length(); i++) { | 14335 i < args.get$length(); i++) { |
| 14318 var arg = args.$index(i); | 14336 var arg = args[i]; |
| 14319 switch (arg) { | 14337 switch (arg) { |
| 14320 case "--enable_leg": | 14338 case "--enable_leg": |
| 14321 | 14339 |
| 14322 this.enableLeg = true; | 14340 this.enableLeg = true; |
| 14323 break; | 14341 break; |
| 14324 | 14342 |
| 14325 case "--leg_only": | 14343 case "--leg_only": |
| 14326 | 14344 |
| 14327 this.enableLeg = true; | 14345 this.enableLeg = true; |
| 14328 this.legOnly = true; | 14346 this.legOnly = true; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14401 | 14419 |
| 14402 case "--Xinfer_types": | 14420 case "--Xinfer_types": |
| 14403 | 14421 |
| 14404 this.inferTypes = true; | 14422 this.inferTypes = true; |
| 14405 break; | 14423 break; |
| 14406 | 14424 |
| 14407 default: | 14425 default: |
| 14408 | 14426 |
| 14409 if (arg.endsWith$1(".dart")) { | 14427 if (arg.endsWith$1(".dart")) { |
| 14410 this.dartScript = arg; | 14428 this.dartScript = arg; |
| 14411 this.childArgs = args.getRange$2(i + (1), args.get$length() - i - (1)) ; | 14429 this.childArgs = args.getRange(i + (1), args.get$length() - i - (1)); |
| 14412 break loop; | 14430 break loop; |
| 14413 } | 14431 } |
| 14414 else if (arg.startsWith$1("--out=")) { | 14432 else if (arg.startsWith$1("--out=")) { |
| 14415 this.outfile = arg.substring$1("--out=".length); | 14433 this.outfile = arg.substring$1("--out=".length); |
| 14416 } | 14434 } |
| 14417 else if (arg.startsWith$1("--libdir=")) { | 14435 else if (arg.startsWith$1("--libdir=")) { |
| 14418 this.libDir = arg.substring$1("--libdir=".length); | 14436 this.libDir = arg.substring$1("--libdir=".length); |
| 14419 passedLibDir = true; | 14437 passedLibDir = true; |
| 14420 } | 14438 } |
| 14421 else { | 14439 else { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14559 } | 14577 } |
| 14560 else { | 14578 else { |
| 14561 code.writeln(("" + this.body + ";")); | 14579 code.writeln(("" + this.body + ";")); |
| 14562 code.exitBlock(suffix); | 14580 code.exitBlock(suffix); |
| 14563 } | 14581 } |
| 14564 } | 14582 } |
| 14565 } | 14583 } |
| 14566 VarMethodStub.prototype._needsExactTypeCheck = function() { | 14584 VarMethodStub.prototype._needsExactTypeCheck = function() { |
| 14567 var $this = this; // closure support | 14585 var $this = this; // closure support |
| 14568 if (this.member == null || this.member.declaringType.get$isObject()) return fa lse; | 14586 if (this.member == null || this.member.declaringType.get$isObject()) return fa lse; |
| 14569 var members = this.member.declaringType.resolveMember(this.member.name).member s; | 14587 var members = this.member.get$potentialMemberSet().members; |
| 14570 return members.filter$1((function (m) { | 14588 return members.filter$1((function (m) { |
| 14571 return $ne(m, $this.member) && m.get$declaringType().get$isHiddenNativeType( ); | 14589 return $ne(m, $this.member) && m.get$declaringType().get$isHiddenNativeType( ); |
| 14572 }) | 14590 }) |
| 14573 ).get$length() >= (1); | 14591 ).get$length() >= (1); |
| 14574 } | 14592 } |
| 14575 VarMethodStub.prototype._useDirectCall = function(args) { | 14593 VarMethodStub.prototype._useDirectCall = function(args) { |
| 14576 if ((this.member instanceof MethodMember) && !this.member.declaringType.get$ha sNativeSubtypes()) { | 14594 if ((this.member instanceof MethodMember) && !this.member.declaringType.get$ha sNativeSubtypes()) { |
| 14577 var method = this.member; | 14595 var method = this.member; |
| 14578 if (method.needsArgumentConversion(args)) { | 14596 if (method.needsArgumentConversion(args)) { |
| 14579 return false; | 14597 return false; |
| 14580 } | 14598 } |
| 14581 for (var i = args.get$length(); | 14599 for (var i = args.get$length(); |
| 14582 i < method.parameters.get$length(); i++) { | 14600 i < method.parameters.get$length(); i++) { |
| 14583 if ($ne(method.parameters.$index(i).get$value().get$code(), "null")) { | 14601 if ($ne(method.parameters[i].get$value().get$code(), "null")) { |
| 14584 return false; | 14602 return false; |
| 14585 } | 14603 } |
| 14586 } | 14604 } |
| 14587 return method.namesInHomePositions(args); | 14605 return method.namesInHomePositions(args); |
| 14588 } | 14606 } |
| 14589 else { | 14607 else { |
| 14590 return false; | 14608 return false; |
| 14591 } | 14609 } |
| 14592 } | 14610 } |
| 14593 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; | 14611 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 14606 VarMethodSet.prototype.invoke = function(context, node, target, args) { | 14624 VarMethodSet.prototype.invoke = function(context, node, target, args) { |
| 14607 this._invokeMembers(context, node); | 14625 this._invokeMembers(context, node); |
| 14608 return VarMember.prototype.invoke.call(this, context, node, target, args); | 14626 return VarMember.prototype.invoke.call(this, context, node, target, args); |
| 14609 } | 14627 } |
| 14610 VarMethodSet.prototype._invokeMembers = function(context, node) { | 14628 VarMethodSet.prototype._invokeMembers = function(context, node) { |
| 14611 if (this.invoked) return; | 14629 if (this.invoked) return; |
| 14612 this.invoked = true; | 14630 this.invoked = true; |
| 14613 var hasObjectType = false; | 14631 var hasObjectType = false; |
| 14614 var $$list = this.members; | 14632 var $$list = this.members; |
| 14615 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 14633 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 14616 var member = $$list.$index($$i); | 14634 var member = $$list[$$i]; |
| 14617 var type = member.get$declaringType(); | 14635 var type = member.get$declaringType(); |
| 14618 var target = new Value(type, "this", node.span); | 14636 var target = new Value(type, "this", node.span); |
| 14619 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e); | 14637 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e); |
| 14620 var stub = new VarMethodStub(this.name, member, this.args, "return " + resul t.get$code()); | 14638 var stub = new VarMethodStub(this.name, member, this.args, "return " + resul t.get$code()); |
| 14621 type.get$varStubs().$setindex(stub.get$name(), stub); | 14639 type.get$varStubs().$setindex(stub.get$name(), stub); |
| 14622 if (type.get$isObject()) hasObjectType = true; | 14640 if (type.get$isObject()) hasObjectType = true; |
| 14623 } | 14641 } |
| 14624 if (!hasObjectType) { | 14642 if (!hasObjectType) { |
| 14625 var target = new Value($globals.world.objectType, "this", node.span); | 14643 var target = new Value($globals.world.objectType, "this", node.span); |
| 14626 var result = target.invokeNoSuchMethod$4(context, this.baseName, node, this. args); | 14644 var result = target.invokeNoSuchMethod$4(context, this.baseName, node, this. args); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 14637 function _otherOperator(jsname, op) { | 14655 function _otherOperator(jsname, op) { |
| 14638 return ("function " + jsname + "(x, y) {\n return (typeof(x) == 'number' && t ypeof(y) == 'number')\n ? x " + op + " y : x." + jsname + "(y);\n}"); | 14656 return ("function " + jsname + "(x, y) {\n return (typeof(x) == 'number' && t ypeof(y) == 'number')\n ? x " + op + " y : x." + jsname + "(y);\n}"); |
| 14639 } | 14657 } |
| 14640 function map(source, mapper) { | 14658 function map(source, mapper) { |
| 14641 var result = new Array(); | 14659 var result = new Array(); |
| 14642 if (!!(source && source.is$List())) { | 14660 if (!!(source && source.is$List())) { |
| 14643 var list = source; | 14661 var list = source; |
| 14644 result.set$length(list.get$length()); | 14662 result.set$length(list.get$length()); |
| 14645 for (var i = (0); | 14663 for (var i = (0); |
| 14646 i < list.get$length(); i++) { | 14664 i < list.get$length(); i++) { |
| 14647 result.$setindex(i, mapper(list.$index(i))); | 14665 result.$setindex(i, mapper.call$1(list[i])); |
| 14648 } | 14666 } |
| 14649 } | 14667 } |
| 14650 else { | 14668 else { |
| 14651 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { | 14669 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { |
| 14652 var item = $$i.next$0(); | 14670 var item = $$i.next$0(); |
| 14653 result.add(mapper(item)); | 14671 result.add(mapper.call$1(item)); |
| 14654 } | 14672 } |
| 14655 } | 14673 } |
| 14656 return result; | 14674 return result; |
| 14657 } | 14675 } |
| 14658 function reduce(source, callback, initialValue) { | 14676 function reduce(source, callback, initialValue) { |
| 14659 var i = source.iterator$0(); | 14677 var i = source.iterator$0(); |
| 14660 var current = initialValue; | 14678 var current = initialValue; |
| 14661 if (current == null && i.hasNext$0()) { | 14679 if (current == null && i.hasNext$0()) { |
| 14662 current = i.next$0(); | 14680 current = i.next$0(); |
| 14663 } | 14681 } |
| 14664 while (i.hasNext$0()) { | 14682 while (i.hasNext$0()) { |
| 14665 current = callback.call$2(current, i.next$0()); | 14683 current = callback.call$2(current, i.next$0()); |
| 14666 } | 14684 } |
| 14667 return current; | 14685 return current; |
| 14668 } | 14686 } |
| 14669 function orderValuesByKeys(map) { | 14687 function orderValuesByKeys(map) { |
| 14670 var keys = map.getKeys(); | 14688 var keys = map.getKeys(); |
| 14671 keys.sort((function (x, y) { | 14689 keys.sort((function (x, y) { |
| 14672 return x.compareTo$1(y); | 14690 return x.compareTo$1(y); |
| 14673 }) | 14691 }) |
| 14674 ); | 14692 ); |
| 14675 var values = []; | 14693 var values = []; |
| 14676 for (var $$i = 0;$$i < keys.get$length(); $$i++) { | 14694 for (var $$i = 0;$$i < keys.get$length(); $$i++) { |
| 14677 var k = keys.$index($$i); | 14695 var k = keys[$$i]; |
| 14678 values.add$1(map.$index(k)); | 14696 values.add$1(map.$index(k)); |
| 14679 } | 14697 } |
| 14680 return values; | 14698 return values; |
| 14681 } | 14699 } |
| 14682 var world; | 14700 var world; |
| 14683 var experimentalAwaitPhase; | 14701 var experimentalAwaitPhase; |
| 14684 var legCompile; | 14702 var legCompile; |
| 14685 function initializeWorld(files) { | 14703 function initializeWorld(files) { |
| 14686 $globals.world = new World(files); | 14704 $globals.world = new World(files); |
| 14687 $globals.world.init(); | 14705 $globals.world.init(); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 14704 if (name0.contains$1("$")) { | 14722 if (name0.contains$1("$")) { |
| 14705 nameBuilder.add$1(("" + name0.get$length())); | 14723 nameBuilder.add$1(("" + name0.get$length())); |
| 14706 } | 14724 } |
| 14707 nameBuilder.add$1(name0); | 14725 nameBuilder.add$1(name0); |
| 14708 } | 14726 } |
| 14709 return nameBuilder.toString$0(); | 14727 return nameBuilder.toString$0(); |
| 14710 } | 14728 } |
| 14711 // ********** Library minfrog ************** | 14729 // ********** Library minfrog ************** |
| 14712 // ********** Code for top level ************** | 14730 // ********** Code for top level ************** |
| 14713 function main() { | 14731 function main() { |
| 14714 var homedir = path.dirname(fs.realpathSync(get$process().get$argv().$index((1) ))); | 14732 var homedir = path.dirname(fs.realpathSync(get$process().get$argv()[(1)])); |
| 14715 var argv = []; | 14733 var argv = []; |
| 14716 for (var i = (0); | 14734 for (var i = (0); |
| 14717 i < get$process().get$argv().get$length(); i++) { | 14735 i < get$process().get$argv().get$length(); i++) { |
| 14718 argv.add$1(get$process().get$argv().$index(i)); | 14736 argv.add$1(get$process().get$argv()[i]); |
| 14719 if (i == (1)) { | 14737 if (i == (1)) { |
| 14720 var terminal = get$process().get$env().$index("TERM"); | 14738 var terminal = get$process().get$env().$index("TERM"); |
| 14721 if (terminal == null || !terminal.startsWith$1("xterm")) { | 14739 if (terminal == null || !terminal.startsWith$1("xterm")) { |
| 14722 argv.add$1("--no_colors"); | 14740 argv.add$1("--no_colors"); |
| 14723 } | 14741 } |
| 14724 } | 14742 } |
| 14725 } | 14743 } |
| 14726 if (compile(homedir, argv, new NodeFileSystem())) { | 14744 if (compile(homedir, argv, new NodeFileSystem())) { |
| 14727 var code = $globals.world.getGeneratedCode(); | 14745 var code = $globals.world.getGeneratedCode(); |
| 14728 if ($globals.options.compileOnly) { | 14746 if ($globals.options.compileOnly) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14767 $globals._RED_COLOR = "\x1b[31m"; | 14785 $globals._RED_COLOR = "\x1b[31m"; |
| 14768 } | 14786 } |
| 14769 var const$0000 = Object.create(EmptyQueueException.prototype, {}); | 14787 var const$0000 = Object.create(EmptyQueueException.prototype, {}); |
| 14770 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); | 14788 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); |
| 14771 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); | 14789 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); |
| 14772 var const$0007 = Object.create(IllegalAccessException.prototype, {}); | 14790 var const$0007 = Object.create(IllegalAccessException.prototype, {}); |
| 14773 var const$0008 = ImmutableList.ImmutableList$from$factory([]); | 14791 var const$0008 = ImmutableList.ImmutableList$from$factory([]); |
| 14774 var $globals = {}; | 14792 var $globals = {}; |
| 14775 $static_init(); | 14793 $static_init(); |
| 14776 main(); | 14794 main(); |
| OLD | NEW |