| 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", []); |
| 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 }); | 121 }, enumerable: false, writable: true, configurable: true }); |
| 125 Object.defineProperty(Object.prototype, "_setindex$2", { value: function($0, $1)
{ | 122 Object.defineProperty(Object.prototype, "_setindex$2", { value: function($0, $1)
{ |
| 126 return this.noSuchMethod("_setindex", [$0, $1]); | 123 return this.noSuchMethod$2("_setindex", [$0, $1]); |
| 127 }, enumerable: false, writable: true, configurable: true }); | 124 }, enumerable: false, writable: true, configurable: true }); |
| 128 Object.defineProperty(Object.prototype, "add$1", { value: function($0) { | 125 Object.defineProperty(Object.prototype, "add$1", { value: function($0) { |
| 129 return this.noSuchMethod("add", [$0]); | 126 return this.noSuchMethod$2("add", [$0]); |
| 130 }, enumerable: false, writable: true, configurable: true }); | 127 }, enumerable: false, writable: true, configurable: true }); |
| 131 Object.defineProperty(Object.prototype, "addAll$1", { value: function($0) { | 128 Object.defineProperty(Object.prototype, "addAll$1", { value: function($0) { |
| 132 return this.noSuchMethod("addAll", [$0]); | 129 return this.noSuchMethod$2("addAll", [$0]); |
| 133 }, enumerable: false, writable: true, configurable: true }); | 130 }, enumerable: false, writable: true, configurable: true }); |
| 134 Object.defineProperty(Object.prototype, "addDirectSubtype$1", { value: function(
$0) { | 131 Object.defineProperty(Object.prototype, "addDirectSubtype$1", { value: function(
$0) { |
| 135 return this.noSuchMethod("addDirectSubtype", [$0]); | 132 return this.noSuchMethod$2("addDirectSubtype", [$0]); |
| 136 }, enumerable: false, writable: true, configurable: true }); | 133 }, enumerable: false, writable: true, configurable: true }); |
| 137 Object.defineProperty(Object.prototype, "addLast$1", { value: function($0) { | 134 Object.defineProperty(Object.prototype, "addLast$1", { value: function($0) { |
| 138 return this.noSuchMethod("addLast", [$0]); | 135 return this.noSuchMethod$2("addLast", [$0]); |
| 139 }, enumerable: false, writable: true, configurable: true }); | 136 }, enumerable: false, writable: true, configurable: true }); |
| 140 Object.defineProperty(Object.prototype, "addMethod$2", { value: function($0, $1)
{ | 137 Object.defineProperty(Object.prototype, "addMethod$2", { value: function($0, $1)
{ |
| 141 return this.noSuchMethod("addMethod", [$0, $1]); | 138 return this.noSuchMethod$2("addMethod", [$0, $1]); |
| 142 }, enumerable: false, writable: true, configurable: true }); | 139 }, enumerable: false, writable: true, configurable: true }); |
| 143 Object.defineProperty(Object.prototype, "addSource$1", { value: function($0) { | 140 Object.defineProperty(Object.prototype, "addSource$1", { value: function($0) { |
| 144 return this.noSuchMethod("addSource", [$0]); | 141 return this.noSuchMethod$2("addSource", [$0]); |
| 145 }, enumerable: false, writable: true, configurable: true }); | 142 }, enumerable: false, writable: true, configurable: true }); |
| 146 Object.defineProperty(Object.prototype, "binop$4", { value: function($0, $1, $2,
$3) { | 143 Object.defineProperty(Object.prototype, "binop$4", { value: function($0, $1, $2,
$3) { |
| 147 return this.noSuchMethod("binop", [$0, $1, $2, $3]); | 144 return this.noSuchMethod$2("binop", [$0, $1, $2, $3]); |
| 148 }, enumerable: false, writable: true, configurable: true }); | 145 }, enumerable: false, writable: true, configurable: true }); |
| 149 Object.defineProperty(Object.prototype, "block$0", { value: function() { | 146 Object.defineProperty(Object.prototype, "block$0", { value: function() { |
| 150 return this.noSuchMethod("block", []); | 147 return this.noSuchMethod$2("block", []); |
| 151 }, enumerable: false, writable: true, configurable: true }); | 148 }, enumerable: false, writable: true, configurable: true }); |
| 152 Object.defineProperty(Object.prototype, "canInvoke$2", { value: function($0, $1)
{ | 149 Object.defineProperty(Object.prototype, "canInvoke$2", { value: function($0, $1)
{ |
| 153 return this.noSuchMethod("canInvoke", [$0, $1]); | 150 return this.noSuchMethod$2("canInvoke", [$0, $1]); |
| 154 }, enumerable: false, writable: true, configurable: true }); | 151 }, enumerable: false, writable: true, configurable: true }); |
| 155 Object.defineProperty(Object.prototype, "checkFirstClass$1", { value: function($
0) { | 152 Object.defineProperty(Object.prototype, "checkFirstClass$1", { value: function($
0) { |
| 156 return this.noSuchMethod("checkFirstClass", [$0]); | 153 return this.noSuchMethod$2("checkFirstClass", [$0]); |
| 157 }, enumerable: false, writable: true, configurable: true }); | 154 }, enumerable: false, writable: true, configurable: true }); |
| 158 Object.defineProperty(Object.prototype, "compareTo$1", { value: function($0) { | 155 Object.defineProperty(Object.prototype, "compareTo$1", { value: function($0) { |
| 159 return this.noSuchMethod("compareTo", [$0]); | 156 return this.noSuchMethod$2("compareTo", [$0]); |
| 160 }, enumerable: false, writable: true, configurable: true }); | 157 }, enumerable: false, writable: true, configurable: true }); |
| 161 Object.defineProperty(Object.prototype, "compilationUnit$0", { value: function()
{ | 158 Object.defineProperty(Object.prototype, "compilationUnit$0", { value: function()
{ |
| 162 return this.noSuchMethod("compilationUnit", []); | 159 return this.noSuchMethod$2("compilationUnit", []); |
| 163 }, enumerable: false, writable: true, configurable: true }); | 160 }, enumerable: false, writable: true, configurable: true }); |
| 164 Object.defineProperty(Object.prototype, "computeValue$0", { value: function() { | 161 Object.defineProperty(Object.prototype, "computeValue$0", { value: function() { |
| 165 return this.noSuchMethod("computeValue", []); | 162 return this.noSuchMethod$2("computeValue", []); |
| 166 }, enumerable: false, writable: true, configurable: true }); | 163 }, enumerable: false, writable: true, configurable: true }); |
| 167 Object.defineProperty(Object.prototype, "contains$1", { value: function($0) { | 164 Object.defineProperty(Object.prototype, "contains$1", { value: function($0) { |
| 168 return this.noSuchMethod("contains", [$0]); | 165 return this.noSuchMethod$2("contains", [$0]); |
| 169 }, enumerable: false, writable: true, configurable: true }); | 166 }, enumerable: false, writable: true, configurable: true }); |
| 170 Object.defineProperty(Object.prototype, "containsKey$1", { value: function($0) { | 167 Object.defineProperty(Object.prototype, "containsKey$1", { value: function($0) { |
| 171 return this.noSuchMethod("containsKey", [$0]); | 168 return this.noSuchMethod$2("containsKey", [$0]); |
| 172 }, enumerable: false, writable: true, configurable: true }); | 169 }, enumerable: false, writable: true, configurable: true }); |
| 173 Object.defineProperty(Object.prototype, "convertTo$2", { value: function($0, $1)
{ | 170 Object.defineProperty(Object.prototype, "convertTo$2", { value: function($0, $1)
{ |
| 174 return this.noSuchMethod("convertTo", [$0, $1]); | 171 return this.noSuchMethod$2("convertTo", [$0, $1]); |
| 175 }, enumerable: false, writable: true, configurable: true }); | 172 }, enumerable: false, writable: true, configurable: true }); |
| 176 Object.defineProperty(Object.prototype, "convertTo$3", { value: function($0, $1,
$2) { | 173 Object.defineProperty(Object.prototype, "convertTo$3", { value: function($0, $1,
$2) { |
| 177 return this.noSuchMethod("convertTo", [$0, $1, $2]); | 174 return this.noSuchMethod$2("convertTo", [$0, $1, $2]); |
| 178 }, enumerable: false, writable: true, configurable: true }); | 175 }, enumerable: false, writable: true, configurable: true }); |
| 179 Object.defineProperty(Object.prototype, "copyWithNewType$2", { value: function($
0, $1) { | 176 Object.defineProperty(Object.prototype, "copyWithNewType$2", { value: function($
0, $1) { |
| 180 return this.noSuchMethod("copyWithNewType", [$0, $1]); | 177 return this.noSuchMethod$2("copyWithNewType", [$0, $1]); |
| 181 }, enumerable: false, writable: true, configurable: true }); | 178 }, enumerable: false, writable: true, configurable: true }); |
| 182 Object.defineProperty(Object.prototype, "create$3$isFinal", { value: function($0
, $1, $2, isFinal) { | 179 Object.defineProperty(Object.prototype, "create$3$isFinal", { value: function($0
, $1, $2, isFinal) { |
| 183 return this.noSuchMethod("create", [$0, $1, $2, isFinal]); | 180 return this.noSuchMethod$2("create", [$0, $1, $2, isFinal]); |
| 184 }, enumerable: false, writable: true, configurable: true }); | 181 }, enumerable: false, writable: true, configurable: true }); |
| 185 Object.defineProperty(Object.prototype, "elapsedInMs$0", { value: function() { | 182 Object.defineProperty(Object.prototype, "elapsedInMs$0", { value: function() { |
| 186 return this.noSuchMethod("elapsedInMs", []); | 183 return this.noSuchMethod$2("elapsedInMs", []); |
| 187 }, enumerable: false, writable: true, configurable: true }); | 184 }, enumerable: false, writable: true, configurable: true }); |
| 188 Object.defineProperty(Object.prototype, "end$0", { value: function() { | 185 Object.defineProperty(Object.prototype, "end$0", { value: function() { |
| 189 return this.noSuchMethod("end", []); | 186 return this.noSuchMethod$2("end", []); |
| 190 }, enumerable: false, writable: true, configurable: true }); | 187 }, enumerable: false, writable: true, configurable: true }); |
| 191 Object.defineProperty(Object.prototype, "endsWith$1", { value: function($0) { | 188 Object.defineProperty(Object.prototype, "endsWith$1", { value: function($0) { |
| 192 return this.noSuchMethod("endsWith", [$0]); | 189 return this.noSuchMethod$2("endsWith", [$0]); |
| 193 }, enumerable: false, writable: true, configurable: true }); | 190 }, enumerable: false, writable: true, configurable: true }); |
| 194 Object.defineProperty(Object.prototype, "ensureSubtypeOf$3", { value: function($
0, $1, $2) { | 191 Object.defineProperty(Object.prototype, "ensureSubtypeOf$3", { value: function($
0, $1, $2) { |
| 195 return this.noSuchMethod("ensureSubtypeOf", [$0, $1, $2]); | 192 return this.noSuchMethod$2("ensureSubtypeOf", [$0, $1, $2]); |
| 196 }, enumerable: false, writable: true, configurable: true }); | 193 }, enumerable: false, writable: true, configurable: true }); |
| 197 Object.defineProperty(Object.prototype, "evalBody$2", { value: function($0, $1)
{ | 194 Object.defineProperty(Object.prototype, "evalBody$2", { value: function($0, $1)
{ |
| 198 return this.noSuchMethod("evalBody", [$0, $1]); | 195 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 }); | 196 }, enumerable: false, writable: true, configurable: true }); |
| 203 Object.defineProperty(Object.prototype, "filter$1", { value: function($0) { | 197 Object.defineProperty(Object.prototype, "filter$1", { value: function($0) { |
| 204 return this.noSuchMethod("filter", [$0]); | 198 return this.noSuchMethod$2("filter", [$0]); |
| 205 }, enumerable: false, writable: true, configurable: true }); | 199 }, enumerable: false, writable: true, configurable: true }); |
| 206 Object.defineProperty(Object.prototype, "findTypeByName$1", { value: function($0
) { | 200 Object.defineProperty(Object.prototype, "findTypeByName$1", { value: function($0
) { |
| 207 return this.noSuchMethod("findTypeByName", [$0]); | 201 return this.noSuchMethod$2("findTypeByName", [$0]); |
| 208 }, enumerable: false, writable: true, configurable: true }); | 202 }, enumerable: false, writable: true, configurable: true }); |
| 209 Object.defineProperty(Object.prototype, "forEach$1", { value: function($0) { | 203 Object.defineProperty(Object.prototype, "forEach$1", { value: function($0) { |
| 210 return this.noSuchMethod("forEach", [$0]); | 204 return this.noSuchMethod$2("forEach", [$0]); |
| 211 }, enumerable: false, writable: true, configurable: true }); | 205 }, enumerable: false, writable: true, configurable: true }); |
| 212 Object.defineProperty(Object.prototype, "genValue$2", { value: function($0, $1)
{ | 206 Object.defineProperty(Object.prototype, "genValue$2", { value: function($0, $1)
{ |
| 213 return this.noSuchMethod("genValue", [$0, $1]); | 207 return this.noSuchMethod$2("genValue", [$0, $1]); |
| 214 }, enumerable: false, writable: true, configurable: true }); | 208 }, enumerable: false, writable: true, configurable: true }); |
| 215 Object.defineProperty(Object.prototype, "generate$1", { value: function($0) { | 209 Object.defineProperty(Object.prototype, "generate$1", { value: function($0) { |
| 216 return this.noSuchMethod("generate", [$0]); | 210 return this.noSuchMethod$2("generate", [$0]); |
| 217 }, enumerable: false, writable: true, configurable: true }); | 211 }, enumerable: false, writable: true, configurable: true }); |
| 218 Object.defineProperty(Object.prototype, "getColumn$2", { value: function($0, $1)
{ | 212 Object.defineProperty(Object.prototype, "getColumn$2", { value: function($0, $1)
{ |
| 219 return this.noSuchMethod("getColumn", [$0, $1]); | 213 return this.noSuchMethod$2("getColumn", [$0, $1]); |
| 220 }, enumerable: false, writable: true, configurable: true }); | 214 }, enumerable: false, writable: true, configurable: true }); |
| 221 Object.defineProperty(Object.prototype, "getConstructor$1", { value: function($0
) { | 215 Object.defineProperty(Object.prototype, "getConstructor$1", { value: function($0
) { |
| 222 return this.noSuchMethod("getConstructor", [$0]); | 216 return this.noSuchMethod$2("getConstructor", [$0]); |
| 223 }, enumerable: false, writable: true, configurable: true }); | 217 }, enumerable: false, writable: true, configurable: true }); |
| 224 Object.defineProperty(Object.prototype, "getFactory$2", { value: function($0, $1
) { | 218 Object.defineProperty(Object.prototype, "getFactory$2", { value: function($0, $1
) { |
| 225 return this.noSuchMethod("getFactory", [$0, $1]); | 219 return this.noSuchMethod$2("getFactory", [$0, $1]); |
| 226 }, enumerable: false, writable: true, configurable: true }); | 220 }, enumerable: false, writable: true, configurable: true }); |
| 227 Object.defineProperty(Object.prototype, "getGlobalValue$0", { value: function()
{ | 221 Object.defineProperty(Object.prototype, "getGlobalValue$0", { value: function()
{ |
| 228 return this.noSuchMethod("getGlobalValue", []); | 222 return this.noSuchMethod$2("getGlobalValue", []); |
| 229 }, enumerable: false, writable: true, configurable: true }); | 223 }, enumerable: false, writable: true, configurable: true }); |
| 230 Object.defineProperty(Object.prototype, "getKeys$0", { value: function() { | 224 Object.defineProperty(Object.prototype, "getKeys$0", { value: function() { |
| 231 return this.noSuchMethod("getKeys", []); | 225 return this.noSuchMethod$2("getKeys", []); |
| 232 }, enumerable: false, writable: true, configurable: true }); | 226 }, enumerable: false, writable: true, configurable: true }); |
| 233 Object.defineProperty(Object.prototype, "getLine$1", { value: function($0) { | 227 Object.defineProperty(Object.prototype, "getLine$1", { value: function($0) { |
| 234 return this.noSuchMethod("getLine", [$0]); | 228 return this.noSuchMethod$2("getLine", [$0]); |
| 235 }, enumerable: false, writable: true, configurable: true }); | 229 }, enumerable: false, writable: true, configurable: true }); |
| 236 Object.defineProperty(Object.prototype, "getMember$1", { value: function($0) { | 230 Object.defineProperty(Object.prototype, "getMember$1", { value: function($0) { |
| 237 return this.noSuchMethod("getMember", [$0]); | 231 return this.noSuchMethod$2("getMember", [$0]); |
| 238 }, enumerable: false, writable: true, configurable: true }); | 232 }, enumerable: false, writable: true, configurable: true }); |
| 239 Object.defineProperty(Object.prototype, "getOrMakeConcreteType$1", { value: func
tion($0) { | 233 Object.defineProperty(Object.prototype, "getOrMakeConcreteType$1", { value: func
tion($0) { |
| 240 return this.noSuchMethod("getOrMakeConcreteType", [$0]); | 234 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 }); | 235 }, enumerable: false, writable: true, configurable: true }); |
| 245 Object.defineProperty(Object.prototype, "getValues$0", { value: function() { | 236 Object.defineProperty(Object.prototype, "getValues$0", { value: function() { |
| 246 return this.noSuchMethod("getValues", []); | 237 return this.noSuchMethod$2("getValues", []); |
| 247 }, enumerable: false, writable: true, configurable: true }); | 238 }, enumerable: false, writable: true, configurable: true }); |
| 248 Object.defineProperty(Object.prototype, "get_$3", { value: function($0, $1, $2)
{ | 239 Object.defineProperty(Object.prototype, "get_$3", { value: function($0, $1, $2)
{ |
| 249 return this.noSuchMethod("get_", [$0, $1, $2]); | 240 return this.noSuchMethod$2("get_", [$0, $1, $2]); |
| 250 }, enumerable: false, writable: true, configurable: true }); | 241 }, enumerable: false, writable: true, configurable: true }); |
| 251 Object.defineProperty(Object.prototype, "hasNext$0", { value: function() { | 242 Object.defineProperty(Object.prototype, "hasNext$0", { value: function() { |
| 252 return this.noSuchMethod("hasNext", []); | 243 return this.noSuchMethod$2("hasNext", []); |
| 253 }, enumerable: false, writable: true, configurable: true }); | 244 }, enumerable: false, writable: true, configurable: true }); |
| 254 Object.defineProperty(Object.prototype, "hashCode$0", { value: function() { | 245 Object.defineProperty(Object.prototype, "hashCode$0", { value: function() { |
| 255 return this.noSuchMethod("hashCode", []); | 246 return this.noSuchMethod$2("hashCode", []); |
| 256 }, enumerable: false, writable: true, configurable: true }); | 247 }, enumerable: false, writable: true, configurable: true }); |
| 257 Object.defineProperty(Object.prototype, "indexOf$1", { value: function($0) { | 248 Object.defineProperty(Object.prototype, "indexOf$1", { value: function($0) { |
| 258 return this.noSuchMethod("indexOf", [$0]); | 249 return this.noSuchMethod$2("indexOf", [$0]); |
| 259 }, enumerable: false, writable: true, configurable: true }); | 250 }, enumerable: false, writable: true, configurable: true }); |
| 260 Object.defineProperty(Object.prototype, "initFields$0", { value: function() { | 251 Object.defineProperty(Object.prototype, "initFields$0", { value: function() { |
| 261 return this.noSuchMethod("initFields", []); | 252 return this.noSuchMethod$2("initFields", []); |
| 262 }, enumerable: false, writable: true, configurable: true }); | 253 }, enumerable: false, writable: true, configurable: true }); |
| 263 Object.defineProperty(Object.prototype, "instanceOf$3$isTrue$forceCheck", { valu
e: function($0, $1, $2, isTrue, forceCheck) { | 254 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]); | 255 return this.noSuchMethod$2("instanceOf", [$0, $1, $2, isTrue, forceCheck]); |
| 265 }, enumerable: false, writable: true, configurable: true }); | 256 }, enumerable: false, writable: true, configurable: true }); |
| 266 Object.defineProperty(Object.prototype, "instanceOf$4", { value: function($0, $1
, $2, $3) { | 257 Object.defineProperty(Object.prototype, "instanceOf$4", { value: function($0, $1
, $2, $3) { |
| 267 return this.noSuchMethod("instanceOf", [$0, $1, $2, $3]); | 258 return this.noSuchMethod$2("instanceOf", [$0, $1, $2, $3]); |
| 268 }, enumerable: false, writable: true, configurable: true }); | 259 }, enumerable: false, writable: true, configurable: true }); |
| 269 Object.defineProperty(Object.prototype, "invoke$4", { value: function($0, $1, $2
, $3) { | 260 Object.defineProperty(Object.prototype, "invoke$4", { value: function($0, $1, $2
, $3) { |
| 270 return this.noSuchMethod("invoke", [$0, $1, $2, $3]); | 261 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3]); |
| 271 }, enumerable: false, writable: true, configurable: true }); | 262 }, enumerable: false, writable: true, configurable: true }); |
| 272 Object.defineProperty(Object.prototype, "invoke$4$isDynamic", { value: function(
$0, $1, $2, $3, isDynamic) { | 263 Object.defineProperty(Object.prototype, "invoke$4$isDynamic", { value: function(
$0, $1, $2, $3, isDynamic) { |
| 273 return this.noSuchMethod("invoke", [$0, $1, $2, $3, isDynamic]); | 264 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3, isDynamic]); |
| 274 }, enumerable: false, writable: true, configurable: true }); | 265 }, enumerable: false, writable: true, configurable: true }); |
| 275 Object.defineProperty(Object.prototype, "invoke$5", { value: function($0, $1, $2
, $3, $4) { | 266 Object.defineProperty(Object.prototype, "invoke$5", { value: function($0, $1, $2
, $3, $4) { |
| 276 return this.noSuchMethod("invoke", [$0, $1, $2, $3, $4]); | 267 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3, $4]); |
| 277 }, enumerable: false, writable: true, configurable: true }); | 268 }, enumerable: false, writable: true, configurable: true }); |
| 278 Object.defineProperty(Object.prototype, "invokeNoSuchMethod$4", { value: functio
n($0, $1, $2, $3) { | 269 Object.defineProperty(Object.prototype, "invokeNoSuchMethod$4", { value: functio
n($0, $1, $2, $3) { |
| 279 return this.noSuchMethod("invokeNoSuchMethod", [$0, $1, $2, $3]); | 270 return this.noSuchMethod$2("invokeNoSuchMethod", [$0, $1, $2, $3]); |
| 280 }, enumerable: false, writable: true, configurable: true }); | 271 }, enumerable: false, writable: true, configurable: true }); |
| 281 Object.defineProperty(Object.prototype, "is$List", { value: function() { | 272 Object.defineProperty(Object.prototype, "is$List", { value: function() { |
| 282 return false; | 273 return false; |
| 283 }, enumerable: false, writable: true, configurable: true }); | 274 }, enumerable: false, writable: true, configurable: true }); |
| 284 Object.defineProperty(Object.prototype, "is$RegExp", { value: function() { | 275 Object.defineProperty(Object.prototype, "is$RegExp", { value: function() { |
| 285 return false; | 276 return false; |
| 286 }, enumerable: false, writable: true, configurable: true }); | 277 }, enumerable: false, writable: true, configurable: true }); |
| 287 Object.defineProperty(Object.prototype, "isAssignable$1", { value: function($0)
{ | 278 Object.defineProperty(Object.prototype, "isAssignable$1", { value: function($0)
{ |
| 288 return this.noSuchMethod("isAssignable", [$0]); | 279 return this.noSuchMethod$2("isAssignable", [$0]); |
| 289 }, enumerable: false, writable: true, configurable: true }); | 280 }, enumerable: false, writable: true, configurable: true }); |
| 290 Object.defineProperty(Object.prototype, "isEmpty$0", { value: function() { | 281 Object.defineProperty(Object.prototype, "isEmpty$0", { value: function() { |
| 291 return this.noSuchMethod("isEmpty", []); | 282 return this.noSuchMethod$2("isEmpty", []); |
| 292 }, enumerable: false, writable: true, configurable: true }); | 283 }, enumerable: false, writable: true, configurable: true }); |
| 293 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) { | 284 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) { |
| 294 return this.noSuchMethod("isSubtypeOf", [$0]); | 285 return this.noSuchMethod$2("isSubtypeOf", [$0]); |
| 295 }, enumerable: false, writable: true, configurable: true }); | 286 }, enumerable: false, writable: true, configurable: true }); |
| 296 Object.defineProperty(Object.prototype, "iterator$0", { value: function() { | 287 Object.defineProperty(Object.prototype, "iterator$0", { value: function() { |
| 297 return this.noSuchMethod("iterator", []); | 288 return this.noSuchMethod$2("iterator", []); |
| 298 }, enumerable: false, writable: true, configurable: true }); | 289 }, enumerable: false, writable: true, configurable: true }); |
| 299 Object.defineProperty(Object.prototype, "last$0", { value: function() { | 290 Object.defineProperty(Object.prototype, "last$0", { value: function() { |
| 300 return this.noSuchMethod("last", []); | 291 return this.noSuchMethod$2("last", []); |
| 301 }, enumerable: false, writable: true, configurable: true }); | 292 }, enumerable: false, writable: true, configurable: true }); |
| 302 Object.defineProperty(Object.prototype, "lookup$2", { value: function($0, $1) { | 293 Object.defineProperty(Object.prototype, "lookup$2", { value: function($0, $1) { |
| 303 return this.noSuchMethod("lookup", [$0, $1]); | 294 return this.noSuchMethod$2("lookup", [$0, $1]); |
| 304 }, enumerable: false, writable: true, configurable: true }); | 295 }, enumerable: false, writable: true, configurable: true }); |
| 305 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() { | 296 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() { |
| 306 return this.noSuchMethod("markUsed", []); | 297 return this.noSuchMethod$2("markUsed", []); |
| 307 }, enumerable: false, writable: true, configurable: true }); | 298 }, enumerable: false, writable: true, configurable: true }); |
| 308 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0)
{ | 299 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0)
{ |
| 309 return this.noSuchMethod("namesInOrder", [$0]); | 300 return this.noSuchMethod$2("namesInOrder", [$0]); |
| 310 }, enumerable: false, writable: true, configurable: true }); | 301 }, enumerable: false, writable: true, configurable: true }); |
| 311 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($
0) { | 302 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($
0) { |
| 312 return this.noSuchMethod("needsConversion", [$0]); | 303 return this.noSuchMethod$2("needsConversion", [$0]); |
| 313 }, enumerable: false, writable: true, configurable: true }); | 304 }, enumerable: false, writable: true, configurable: true }); |
| 314 Object.defineProperty(Object.prototype, "next$0", { value: function() { | 305 Object.defineProperty(Object.prototype, "next$0", { value: function() { |
| 315 return this.noSuchMethod("next", []); | 306 return this.noSuchMethod$2("next", []); |
| 307 }, enumerable: false, writable: true, configurable: true }); |
| 308 Object.defineProperty(Object.prototype, "noSuchMethod$2", { value: function($0,
$1) { |
| 309 return this.noSuchMethod($0, $1); |
| 316 }, enumerable: false, writable: true, configurable: true }); | 310 }, enumerable: false, writable: true, configurable: true }); |
| 317 Object.defineProperty(Object.prototype, "postResolveChecks$0", { value: function
() { | 311 Object.defineProperty(Object.prototype, "postResolveChecks$0", { value: function
() { |
| 318 return this.noSuchMethod("postResolveChecks", []); | 312 return this.noSuchMethod$2("postResolveChecks", []); |
| 319 }, enumerable: false, writable: true, configurable: true }); | 313 }, enumerable: false, writable: true, configurable: true }); |
| 320 Object.defineProperty(Object.prototype, "provideFieldSyntax$0", { value: functio
n() { | 314 Object.defineProperty(Object.prototype, "provideFieldSyntax$0", { value: functio
n() { |
| 321 return this.noSuchMethod("provideFieldSyntax", []); | 315 return this.noSuchMethod$2("provideFieldSyntax", []); |
| 322 }, enumerable: false, writable: true, configurable: true }); | 316 }, enumerable: false, writable: true, configurable: true }); |
| 323 Object.defineProperty(Object.prototype, "providePropertySyntax$0", { value: func
tion() { | 317 Object.defineProperty(Object.prototype, "providePropertySyntax$0", { value: func
tion() { |
| 324 return this.noSuchMethod("providePropertySyntax", []); | 318 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 }); | 319 }, enumerable: false, writable: true, configurable: true }); |
| 332 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { | 320 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { |
| 333 return this.noSuchMethod("removeLast", []); | 321 return this.noSuchMethod$2("removeLast", []); |
| 334 }, enumerable: false, writable: true, configurable: true }); | 322 }, enumerable: false, writable: true, configurable: true }); |
| 335 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0,
$1) { | 323 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0,
$1) { |
| 336 return this.noSuchMethod("replaceFirst", [$0, $1]); | 324 return this.noSuchMethod$2("replaceFirst", [$0, $1]); |
| 337 }, enumerable: false, writable: true, configurable: true }); | 325 }, enumerable: false, writable: true, configurable: true }); |
| 338 Object.defineProperty(Object.prototype, "replaceValue$1", { value: function($0)
{ | 326 Object.defineProperty(Object.prototype, "replaceValue$1", { value: function($0)
{ |
| 339 return this.noSuchMethod("replaceValue", [$0]); | 327 return this.noSuchMethod$2("replaceValue", [$0]); |
| 340 }, enumerable: false, writable: true, configurable: true }); | 328 }, enumerable: false, writable: true, configurable: true }); |
| 341 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { | 329 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { |
| 342 return this.noSuchMethod("resolve", []); | 330 return this.noSuchMethod$2("resolve", []); |
| 343 }, enumerable: false, writable: true, configurable: true }); | 331 }, enumerable: false, writable: true, configurable: true }); |
| 344 Object.defineProperty(Object.prototype, "resolveType$2", { value: function($0, $
1) { | 332 Object.defineProperty(Object.prototype, "resolveType$2", { value: function($0, $
1) { |
| 345 return this.noSuchMethod("resolveType", [$0, $1]); | 333 return this.noSuchMethod$2("resolveType", [$0, $1]); |
| 346 }, enumerable: false, writable: true, configurable: true }); | 334 }, enumerable: false, writable: true, configurable: true }); |
| 347 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function
($0) { | 335 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function
($0) { |
| 348 return this.noSuchMethod("resolveTypeParams", [$0]); | 336 return this.noSuchMethod$2("resolveTypeParams", [$0]); |
| 349 }, enumerable: false, writable: true, configurable: true }); | 337 }, enumerable: false, writable: true, configurable: true }); |
| 350 Object.defineProperty(Object.prototype, "run$0", { value: function() { | 338 Object.defineProperty(Object.prototype, "run$0", { value: function() { |
| 351 return this.noSuchMethod("run", []); | 339 return this.noSuchMethod$2("run", []); |
| 352 }, enumerable: false, writable: true, configurable: true }); | 340 }, enumerable: false, writable: true, configurable: true }); |
| 353 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0)
{ | 341 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0)
{ |
| 354 return this.noSuchMethod("setDefinition", [$0]); | 342 return this.noSuchMethod$2("setDefinition", [$0]); |
| 355 }, enumerable: false, writable: true, configurable: true }); | 343 }, enumerable: false, writable: true, configurable: true }); |
| 356 Object.defineProperty(Object.prototype, "set_$4", { value: function($0, $1, $2,
$3) { | 344 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]); | 345 return this.noSuchMethod$2("setIndex", [$0, $1, $2, $3, kind, returnKind]); |
| 358 }, enumerable: false, writable: true, configurable: true }); | 346 }, enumerable: false, writable: true, configurable: true }); |
| 359 Object.defineProperty(Object.prototype, "some$1", { value: function($0) { | 347 Object.defineProperty(Object.prototype, "set_$4$kind$returnKind", { value: funct
ion($0, $1, $2, $3, kind, returnKind) { |
| 360 return this.noSuchMethod("some", [$0]); | 348 return this.noSuchMethod$2("set_", [$0, $1, $2, $3, kind, returnKind]); |
| 361 }, enumerable: false, writable: true, configurable: true }); | 349 }, enumerable: false, writable: true, configurable: true }); |
| 362 Object.defineProperty(Object.prototype, "sort$1", { value: function($0) { | 350 Object.defineProperty(Object.prototype, "sort$1", { value: function($0) { |
| 363 return this.noSuchMethod("sort", [$0]); | 351 return this.noSuchMethod$2("sort", [$0]); |
| 364 }, enumerable: false, writable: true, configurable: true }); | 352 }, enumerable: false, writable: true, configurable: true }); |
| 365 Object.defineProperty(Object.prototype, "start$0", { value: function() { | 353 Object.defineProperty(Object.prototype, "start$0", { value: function() { |
| 366 return this.noSuchMethod("start", []); | 354 return this.noSuchMethod$2("start", []); |
| 367 }, enumerable: false, writable: true, configurable: true }); | 355 }, enumerable: false, writable: true, configurable: true }); |
| 368 Object.defineProperty(Object.prototype, "startsWith$1", { value: function($0) { | 356 Object.defineProperty(Object.prototype, "startsWith$1", { value: function($0) { |
| 369 return this.noSuchMethod("startsWith", [$0]); | 357 return this.noSuchMethod$2("startsWith", [$0]); |
| 370 }, enumerable: false, writable: true, configurable: true }); | 358 }, enumerable: false, writable: true, configurable: true }); |
| 371 Object.defineProperty(Object.prototype, "stop$0", { value: function() { | 359 Object.defineProperty(Object.prototype, "stop$0", { value: function() { |
| 372 return this.noSuchMethod("stop", []); | 360 return this.noSuchMethod$2("stop", []); |
| 373 }, enumerable: false, writable: true, configurable: true }); | 361 }, enumerable: false, writable: true, configurable: true }); |
| 374 Object.defineProperty(Object.prototype, "substring$1", { value: function($0) { | 362 Object.defineProperty(Object.prototype, "substring$1", { value: function($0) { |
| 375 return this.noSuchMethod("substring", [$0]); | 363 return this.noSuchMethod$2("substring", [$0]); |
| 376 }, enumerable: false, writable: true, configurable: true }); | 364 }, enumerable: false, writable: true, configurable: true }); |
| 377 Object.defineProperty(Object.prototype, "substring$2", { value: function($0, $1)
{ | 365 Object.defineProperty(Object.prototype, "substring$2", { value: function($0, $1)
{ |
| 378 return this.noSuchMethod("substring", [$0, $1]); | 366 return this.noSuchMethod$2("substring", [$0, $1]); |
| 379 }, enumerable: false, writable: true, configurable: true }); | 367 }, enumerable: false, writable: true, configurable: true }); |
| 380 Object.defineProperty(Object.prototype, "toRadixString$1", { value: function($0)
{ | 368 Object.defineProperty(Object.prototype, "toRadixString$1", { value: function($0)
{ |
| 381 return this.noSuchMethod("toRadixString", [$0]); | 369 return this.noSuchMethod$2("toRadixString", [$0]); |
| 382 }, enumerable: false, writable: true, configurable: true }); | 370 }, enumerable: false, writable: true, configurable: true }); |
| 383 Object.defineProperty(Object.prototype, "toString$0", { value: function() { | 371 Object.defineProperty(Object.prototype, "toString$0", { value: function() { |
| 384 return this.toString(); | 372 return this.toString(); |
| 385 }, enumerable: false, writable: true, configurable: true }); | 373 }, enumerable: false, writable: true, configurable: true }); |
| 386 Object.defineProperty(Object.prototype, "unop$3", { value: function($0, $1, $2)
{ | 374 Object.defineProperty(Object.prototype, "unop$3", { value: function($0, $1, $2)
{ |
| 387 return this.noSuchMethod("unop", [$0, $1, $2]); | 375 return this.noSuchMethod$2("unop", [$0, $1, $2]); |
| 388 }, enumerable: false, writable: true, configurable: true }); | 376 }, enumerable: false, writable: true, configurable: true }); |
| 389 Object.defineProperty(Object.prototype, "visit$1", { value: function($0) { | 377 Object.defineProperty(Object.prototype, "visit$1", { value: function($0) { |
| 390 return this.noSuchMethod("visit", [$0]); | 378 return this.noSuchMethod$2("visit", [$0]); |
| 379 }, enumerable: false, writable: true, configurable: true }); |
| 380 Object.defineProperty(Object.prototype, "visitAssertStatement$1", { value: funct
ion($0) { |
| 381 return this.noSuchMethod$2("visitAssertStatement", [$0]); |
| 391 }, enumerable: false, writable: true, configurable: true }); | 382 }, enumerable: false, writable: true, configurable: true }); |
| 392 Object.defineProperty(Object.prototype, "visitBinaryExpression$1", { value: func
tion($0) { | 383 Object.defineProperty(Object.prototype, "visitBinaryExpression$1", { value: func
tion($0) { |
| 393 return this.noSuchMethod("visitBinaryExpression", [$0]); | 384 return this.noSuchMethod$2("visitBinaryExpression", [$0]); |
| 385 }, enumerable: false, writable: true, configurable: true }); |
| 386 Object.defineProperty(Object.prototype, "visitBlockStatement$1", { value: functi
on($0) { |
| 387 return this.noSuchMethod$2("visitBlockStatement", [$0]); |
| 388 }, enumerable: false, writable: true, configurable: true }); |
| 389 Object.defineProperty(Object.prototype, "visitBreakStatement$1", { value: functi
on($0) { |
| 390 return this.noSuchMethod$2("visitBreakStatement", [$0]); |
| 391 }, enumerable: false, writable: true, configurable: true }); |
| 392 Object.defineProperty(Object.prototype, "visitContinueStatement$1", { value: fun
ction($0) { |
| 393 return this.noSuchMethod$2("visitContinueStatement", [$0]); |
| 394 }, enumerable: false, writable: true, configurable: true }); |
| 395 Object.defineProperty(Object.prototype, "visitDeclaredIdentifier$1", { value: fu
nction($0) { |
| 396 return this.noSuchMethod$2("visitDeclaredIdentifier", [$0]); |
| 397 }, enumerable: false, writable: true, configurable: true }); |
| 398 Object.defineProperty(Object.prototype, "visitDietStatement$1", { value: functio
n($0) { |
| 399 return this.noSuchMethod$2("visitDietStatement", [$0]); |
| 400 }, enumerable: false, writable: true, configurable: true }); |
| 401 Object.defineProperty(Object.prototype, "visitDoStatement$1", { value: function(
$0) { |
| 402 return this.noSuchMethod$2("visitDoStatement", [$0]); |
| 403 }, enumerable: false, writable: true, configurable: true }); |
| 404 Object.defineProperty(Object.prototype, "visitEmptyStatement$1", { value: functi
on($0) { |
| 405 return this.noSuchMethod$2("visitEmptyStatement", [$0]); |
| 406 }, enumerable: false, writable: true, configurable: true }); |
| 407 Object.defineProperty(Object.prototype, "visitExpressionStatement$1", { value: f
unction($0) { |
| 408 return this.noSuchMethod$2("visitExpressionStatement", [$0]); |
| 409 }, enumerable: false, writable: true, configurable: true }); |
| 410 Object.defineProperty(Object.prototype, "visitForInStatement$1", { value: functi
on($0) { |
| 411 return this.noSuchMethod$2("visitForInStatement", [$0]); |
| 412 }, enumerable: false, writable: true, configurable: true }); |
| 413 Object.defineProperty(Object.prototype, "visitForStatement$1", { value: function
($0) { |
| 414 return this.noSuchMethod$2("visitForStatement", [$0]); |
| 415 }, enumerable: false, writable: true, configurable: true }); |
| 416 Object.defineProperty(Object.prototype, "visitFunctionDefinition$1", { value: fu
nction($0) { |
| 417 return this.noSuchMethod$2("visitFunctionDefinition", [$0]); |
| 418 }, enumerable: false, writable: true, configurable: true }); |
| 419 Object.defineProperty(Object.prototype, "visitIfStatement$1", { value: function(
$0) { |
| 420 return this.noSuchMethod$2("visitIfStatement", [$0]); |
| 421 }, enumerable: false, writable: true, configurable: true }); |
| 422 Object.defineProperty(Object.prototype, "visitIndexExpression$1", { value: funct
ion($0) { |
| 423 return this.noSuchMethod$2("visitIndexExpression", [$0]); |
| 424 }, enumerable: false, writable: true, configurable: true }); |
| 425 Object.defineProperty(Object.prototype, "visitLabeledStatement$1", { value: func
tion($0) { |
| 426 return this.noSuchMethod$2("visitLabeledStatement", [$0]); |
| 427 }, enumerable: false, writable: true, configurable: true }); |
| 428 Object.defineProperty(Object.prototype, "visitLambdaExpression$1", { value: func
tion($0) { |
| 429 return this.noSuchMethod$2("visitLambdaExpression", [$0]); |
| 430 }, enumerable: false, writable: true, configurable: true }); |
| 431 Object.defineProperty(Object.prototype, "visitLiteralExpression$1", { value: fun
ction($0) { |
| 432 return this.noSuchMethod$2("visitLiteralExpression", [$0]); |
| 433 }, enumerable: false, writable: true, configurable: true }); |
| 434 Object.defineProperty(Object.prototype, "visitMapExpression$1", { value: functio
n($0) { |
| 435 return this.noSuchMethod$2("visitMapExpression", [$0]); |
| 436 }, enumerable: false, writable: true, configurable: true }); |
| 437 Object.defineProperty(Object.prototype, "visitNewExpression$1", { value: functio
n($0) { |
| 438 return this.noSuchMethod$2("visitNewExpression", [$0]); |
| 394 }, enumerable: false, writable: true, configurable: true }); | 439 }, enumerable: false, writable: true, configurable: true }); |
| 395 Object.defineProperty(Object.prototype, "visitPostfixExpression$1", { value: fun
ction($0) { | 440 Object.defineProperty(Object.prototype, "visitPostfixExpression$1", { value: fun
ction($0) { |
| 396 return this.noSuchMethod("visitPostfixExpression", [$0]); | 441 return this.noSuchMethod$2("visitPostfixExpression", [$0]); |
| 442 }, enumerable: false, writable: true, configurable: true }); |
| 443 Object.defineProperty(Object.prototype, "visitReturnStatement$1", { value: funct
ion($0) { |
| 444 return this.noSuchMethod$2("visitReturnStatement", [$0]); |
| 397 }, enumerable: false, writable: true, configurable: true }); | 445 }, enumerable: false, writable: true, configurable: true }); |
| 398 Object.defineProperty(Object.prototype, "visitSources$0", { value: function() { | 446 Object.defineProperty(Object.prototype, "visitSources$0", { value: function() { |
| 399 return this.noSuchMethod("visitSources", []); | 447 return this.noSuchMethod$2("visitSources", []); |
| 448 }, enumerable: false, writable: true, configurable: true }); |
| 449 Object.defineProperty(Object.prototype, "visitSwitchStatement$1", { value: funct
ion($0) { |
| 450 return this.noSuchMethod$2("visitSwitchStatement", [$0]); |
| 451 }, enumerable: false, writable: true, configurable: true }); |
| 452 Object.defineProperty(Object.prototype, "visitThrowStatement$1", { value: functi
on($0) { |
| 453 return this.noSuchMethod$2("visitThrowStatement", [$0]); |
| 454 }, enumerable: false, writable: true, configurable: true }); |
| 455 Object.defineProperty(Object.prototype, "visitTryStatement$1", { value: function
($0) { |
| 456 return this.noSuchMethod$2("visitTryStatement", [$0]); |
| 457 }, enumerable: false, writable: true, configurable: true }); |
| 458 Object.defineProperty(Object.prototype, "visitVariableDefinition$1", { value: fu
nction($0) { |
| 459 return this.noSuchMethod$2("visitVariableDefinition", [$0]); |
| 460 }, enumerable: false, writable: true, configurable: true }); |
| 461 Object.defineProperty(Object.prototype, "visitWhileStatement$1", { value: functi
on($0) { |
| 462 return this.noSuchMethod$2("visitWhileStatement", [$0]); |
| 400 }, enumerable: false, writable: true, configurable: true }); | 463 }, enumerable: false, writable: true, configurable: true }); |
| 401 Object.defineProperty(Object.prototype, "write$1", { value: function($0) { | 464 Object.defineProperty(Object.prototype, "write$1", { value: function($0) { |
| 402 return this.noSuchMethod("write", [$0]); | 465 return this.noSuchMethod$2("write", [$0]); |
| 403 }, enumerable: false, writable: true, configurable: true }); | 466 }, enumerable: false, writable: true, configurable: true }); |
| 404 Object.defineProperty(Object.prototype, "writeDefinition$2", { value: function($
0, $1) { | 467 Object.defineProperty(Object.prototype, "writeDefinition$2", { value: function($
0, $1) { |
| 405 return this.noSuchMethod("writeDefinition", [$0, $1]); | 468 return this.noSuchMethod$2("writeDefinition", [$0, $1]); |
| 406 }, enumerable: false, writable: true, configurable: true }); | 469 }, enumerable: false, writable: true, configurable: true }); |
| 407 // ********** Code for Clock ************** | 470 // ********** Code for Clock ************** |
| 408 function Clock() {} | 471 function Clock() {} |
| 409 Clock.now = function() { | 472 Clock.now = function() { |
| 410 return new Date().getTime(); | 473 return new Date().getTime(); |
| 411 } | 474 } |
| 412 Clock.frequency = function() { | 475 Clock.frequency = function() { |
| 413 return (1000); | 476 return (1000); |
| 414 } | 477 } |
| 415 // ********** Code for IllegalAccessException ************** | 478 // ********** Code for IllegalAccessException ************** |
| (...skipping 10 matching lines...) Expand all Loading... |
| 426 this._functionName = _functionName; | 489 this._functionName = _functionName; |
| 427 this._arguments = _arguments; | 490 this._arguments = _arguments; |
| 428 } | 491 } |
| 429 NoSuchMethodException.prototype.toString = function() { | 492 NoSuchMethodException.prototype.toString = function() { |
| 430 var sb = new StringBufferImpl(""); | 493 var sb = new StringBufferImpl(""); |
| 431 for (var i = (0); | 494 for (var i = (0); |
| 432 i < this._arguments.get$length(); i++) { | 495 i < this._arguments.get$length(); i++) { |
| 433 if (i > (0)) { | 496 if (i > (0)) { |
| 434 sb.add(", "); | 497 sb.add(", "); |
| 435 } | 498 } |
| 436 sb.add(this._arguments.$index(i)); | 499 sb.add(this._arguments[i]); |
| 437 } | 500 } |
| 438 sb.add("]"); | 501 sb.add("]"); |
| 439 return ("NoSuchMethodException - receiver: '" + this._receiver + "' ") + ("fun
ction name: '" + this._functionName + "' arguments: [" + sb + "]"); | 502 return ("NoSuchMethodException - receiver: '" + this._receiver + "' ") + ("fun
ction name: '" + this._functionName + "' arguments: [" + sb + "]"); |
| 440 } | 503 } |
| 441 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS
tring; | 504 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS
tring; |
| 442 // ********** Code for ClosureArgumentMismatchException ************** | 505 // ********** Code for ClosureArgumentMismatchException ************** |
| 443 function ClosureArgumentMismatchException() { | 506 function ClosureArgumentMismatchException() { |
| 444 | 507 |
| 445 } | 508 } |
| 446 ClosureArgumentMismatchException.prototype.toString = function() { | 509 ClosureArgumentMismatchException.prototype.toString = function() { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 }, enumerable: false, writable: true, configurable: true }); | 719 }, enumerable: false, writable: true, configurable: true }); |
| 657 Object.defineProperty(ListFactory.prototype, "isEmpty", { value: function() { | 720 Object.defineProperty(ListFactory.prototype, "isEmpty", { value: function() { |
| 658 return this.get$length() == (0); | 721 return this.get$length() == (0); |
| 659 }, enumerable: false, writable: true, configurable: true }); | 722 }, enumerable: false, writable: true, configurable: true }); |
| 660 Object.defineProperty(ListFactory.prototype, "iterator", { value: function() { | 723 Object.defineProperty(ListFactory.prototype, "iterator", { value: function() { |
| 661 return new ListIterator(this); | 724 return new ListIterator(this); |
| 662 }, enumerable: false, writable: true, configurable: true }); | 725 }, enumerable: false, writable: true, configurable: true }); |
| 663 Object.defineProperty(ListFactory.prototype, "add$1", { value: ListFactory.proto
type.add, enumerable: false, writable: true, configurable: true }); | 726 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 }); | 727 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 }); | 728 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) { | 729 Object.defineProperty(ListFactory.prototype, "filter$1", { value: function($0) { |
| 670 return this.filter(to$call$1($0)); | 730 return this.filter(to$call$1($0)); |
| 671 }, enumerable: false, writable: true, configurable: true }); | 731 }, enumerable: false, writable: true, configurable: true }); |
| 672 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0)
{ | 732 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0)
{ |
| 673 return this.forEach(to$call$1($0)); | 733 return this.forEach(to$call$1($0)); |
| 674 }, enumerable: false, writable: true, configurable: true }); | 734 }, 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 }); | 735 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 }); | 736 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 }); | 737 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 }); | 738 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 })
; | 739 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) { | 740 Object.defineProperty(ListFactory.prototype, "sort$1", { value: function($0) { |
| 685 return this.sort(to$call$2($0)); | 741 return this.sort(to$call$2($0)); |
| 686 }, enumerable: false, writable: true, configurable: true }); | 742 }, enumerable: false, writable: true, configurable: true }); |
| 687 ListFactory_E = ListFactory; | 743 ListFactory_E = ListFactory; |
| 688 ListFactory_Expression = ListFactory; | 744 ListFactory_Expression = ListFactory; |
| 689 ListFactory_K = ListFactory; | 745 ListFactory_K = ListFactory; |
| 690 ListFactory_dart_core_String = ListFactory; | 746 ListFactory_dart_core_String = ListFactory; |
| 691 ListFactory_V = ListFactory; | 747 ListFactory_V = ListFactory; |
| 692 ListFactory_VariableValue = ListFactory; | 748 ListFactory_VariableValue = ListFactory; |
| 693 ListFactory_int = ListFactory; | 749 ListFactory_int = ListFactory; |
| 694 // ********** Code for ListIterator ************** | 750 // ********** Code for ListIterator ************** |
| 695 function ListIterator(array) { | 751 function ListIterator(array) { |
| 696 this._array = array; | 752 this._array = array; |
| 697 this._pos = (0); | 753 this._pos = (0); |
| 698 } | 754 } |
| 699 ListIterator.prototype.hasNext = function() { | 755 ListIterator.prototype.hasNext = function() { |
| 700 return this._array.get$length() > this._pos; | 756 return this._array.get$length() > this._pos; |
| 701 } | 757 } |
| 702 ListIterator.prototype.next = function() { | 758 ListIterator.prototype.next = function() { |
| 703 if (!this.hasNext()) { | 759 if (!this.hasNext()) { |
| 704 $throw(const$0005); | 760 $throw(const$0005); |
| 705 } | 761 } |
| 706 return this._array.$index(this._pos++); | 762 return this._array[this._pos++]; |
| 707 } | 763 } |
| 708 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; | 764 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; |
| 709 ListIterator.prototype.next$0 = ListIterator.prototype.next; | 765 ListIterator.prototype.next$0 = ListIterator.prototype.next; |
| 710 // ********** Code for ImmutableList ************** | 766 // ********** Code for ImmutableList ************** |
| 711 /** Implements extends for Dart classes on JavaScript prototypes. */ | 767 /** Implements extends for Dart classes on JavaScript prototypes. */ |
| 712 function $inherits(child, parent) { | 768 function $inherits(child, parent) { |
| 713 if (child.prototype.__proto__) { | 769 if (child.prototype.__proto__) { |
| 714 child.prototype.__proto__ = parent.prototype; | 770 child.prototype.__proto__ = parent.prototype; |
| 715 } else { | 771 } else { |
| 716 function tmp() {}; | 772 function tmp() {}; |
| 717 tmp.prototype = parent.prototype; | 773 tmp.prototype = parent.prototype; |
| 718 child.prototype = new tmp(); | 774 child.prototype = new tmp(); |
| 719 child.prototype.constructor = child; | 775 child.prototype.constructor = child; |
| 720 } | 776 } |
| 721 } | 777 } |
| 722 $inherits(ImmutableList, ListFactory_E); | 778 $inherits(ImmutableList, ListFactory_E); |
| 723 function ImmutableList(length) { | 779 function ImmutableList(length) { |
| 724 this._length = length; | 780 this._length = length; |
| 725 Array.call(this, length); | 781 Array.call(this, length); |
| 726 } | 782 } |
| 727 ImmutableList.ImmutableList$from$factory = function(other) { | 783 ImmutableList.ImmutableList$from$factory = function(other) { |
| 728 var list = new ImmutableList(other.get$length()); | 784 var list = new ImmutableList(other.get$length()); |
| 729 for (var i = (0); | 785 for (var i = (0); |
| 730 i < other.get$length(); i++) { | 786 i < other.get$length(); i++) { |
| 731 list._setindex$2(i, other.$index(i)); | 787 list._setindex$2(i, other[i]); |
| 732 } | 788 } |
| 733 return list; | 789 return list; |
| 734 } | 790 } |
| 735 ImmutableList.prototype.get$length = function() { | 791 ImmutableList.prototype.get$length = function() { |
| 736 return this._length; | 792 return this._length; |
| 737 } | 793 } |
| 738 ImmutableList.prototype.set$length = function(length) { | 794 ImmutableList.prototype.set$length = function(length) { |
| 739 $throw(const$0007); | 795 $throw(const$0007); |
| 740 } | 796 } |
| 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) { | 797 ImmutableList.prototype._setindex = function(index, value) { |
| 746 return this[index] = value; | 798 return this[index] = value; |
| 747 } | 799 } |
| 748 ImmutableList.prototype.$setindex = function(index, value) { | 800 ImmutableList.prototype.$setindex = function(index, value) { |
| 749 $throw(const$0007); | 801 $throw(const$0007); |
| 750 } | 802 } |
| 751 ImmutableList.prototype.sort = function(compare) { | 803 ImmutableList.prototype.sort = function(compare) { |
| 752 $throw(const$0007); | 804 $throw(const$0007); |
| 753 } | 805 } |
| 754 ImmutableList.prototype.add = function(element) { | 806 ImmutableList.prototype.add = function(element) { |
| 755 $throw(const$0007); | 807 $throw(const$0007); |
| 756 } | 808 } |
| 757 ImmutableList.prototype.addLast = function(element) { | 809 ImmutableList.prototype.addLast = function(element) { |
| 758 $throw(const$0007); | 810 $throw(const$0007); |
| 759 } | 811 } |
| 760 ImmutableList.prototype.addAll = function(elements) { | 812 ImmutableList.prototype.addAll = function(elements) { |
| 761 $throw(const$0007); | 813 $throw(const$0007); |
| 762 } | 814 } |
| 763 ImmutableList.prototype.clear = function() { | 815 ImmutableList.prototype.clear = function() { |
| 764 $throw(const$0007); | 816 $throw(const$0007); |
| 765 } | 817 } |
| 766 ImmutableList.prototype.removeLast = function() { | 818 ImmutableList.prototype.removeLast = function() { |
| 767 $throw(const$0007); | 819 $throw(const$0007); |
| 768 } | 820 } |
| 769 ImmutableList.prototype.toString = function() { | 821 ImmutableList.prototype.toString = function() { |
| 770 return ListFactory.ListFactory$from$factory(this).toString(); | 822 return ListFactory.ListFactory$from$factory(this).toString$0(); |
| 771 } | 823 } |
| 772 ImmutableList.prototype._setindex$2 = ImmutableList.prototype._setindex; | 824 ImmutableList.prototype._setindex$2 = ImmutableList.prototype._setindex; |
| 773 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; | 825 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; |
| 774 ImmutableList.prototype.addAll$1 = ImmutableList.prototype.addAll; | 826 ImmutableList.prototype.addAll$1 = ImmutableList.prototype.addAll; |
| 775 ImmutableList.prototype.addLast$1 = ImmutableList.prototype.addLast; | 827 ImmutableList.prototype.addLast$1 = ImmutableList.prototype.addLast; |
| 776 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; | 828 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; |
| 777 ImmutableList.prototype.sort$1 = function($0) { | 829 ImmutableList.prototype.sort$1 = function($0) { |
| 778 return this.sort(to$call$2($0)); | 830 return this.sort(to$call$2($0)); |
| 779 }; | 831 }; |
| 780 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString; | 832 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 ); | 894 ); |
| 843 return result; | 895 return result; |
| 844 } | 896 } |
| 845 HashMapImplementation._computeLoadLimit = function(capacity) { | 897 HashMapImplementation._computeLoadLimit = function(capacity) { |
| 846 return $truncdiv((capacity * (3)), (4)); | 898 return $truncdiv((capacity * (3)), (4)); |
| 847 } | 899 } |
| 848 HashMapImplementation._firstProbe = function(hashCode, length) { | 900 HashMapImplementation._firstProbe = function(hashCode, length) { |
| 849 return hashCode & (length - (1)); | 901 return hashCode & (length - (1)); |
| 850 } | 902 } |
| 851 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
) { | 903 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
) { |
| 852 return (currentProbe + numberOfProbes) & (length - (1)); | 904 return ($add(currentProbe, numberOfProbes)) & (length - (1)); |
| 853 } | 905 } |
| 854 HashMapImplementation.prototype._probeForAdding = function(key) { | 906 HashMapImplementation.prototype._probeForAdding = function(key) { |
| 855 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 907 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 856 var numberOfProbes = (1); | 908 var numberOfProbes = (1); |
| 857 var initialHash = hash; | 909 var initialHash = hash; |
| 858 var insertionIndex = (-1); | 910 var insertionIndex = (-1); |
| 859 while (true) { | 911 while (true) { |
| 860 var existingKey = this._keys.$index(hash); | 912 var existingKey = this._keys[hash]; |
| 861 if (existingKey == null) { | 913 if (existingKey == null) { |
| 862 if (insertionIndex < (0)) return hash; | 914 if (insertionIndex < (0)) return hash; |
| 863 return insertionIndex; | 915 return insertionIndex; |
| 864 } | 916 } |
| 865 else if ($eq(existingKey, key)) { | 917 else if ($eq(existingKey, key)) { |
| 866 return hash; | 918 return hash; |
| 867 } | 919 } |
| 868 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 920 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 869 insertionIndex = hash; | 921 insertionIndex = hash; |
| 870 } | 922 } |
| 871 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 923 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 872 } | 924 } |
| 873 } | 925 } |
| 874 HashMapImplementation.prototype._probeForLookup = function(key) { | 926 HashMapImplementation.prototype._probeForLookup = function(key) { |
| 875 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 927 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 876 var numberOfProbes = (1); | 928 var numberOfProbes = (1); |
| 877 var initialHash = hash; | 929 var initialHash = hash; |
| 878 while (true) { | 930 while (true) { |
| 879 var existingKey = this._keys.$index(hash); | 931 var existingKey = this._keys[hash]; |
| 880 if (existingKey == null) return (-1); | 932 if (existingKey == null) return (-1); |
| 881 if ($eq(existingKey, key)) return hash; | 933 if ($eq(existingKey, key)) return hash; |
| 882 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 934 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 883 } | 935 } |
| 884 } | 936 } |
| 885 HashMapImplementation.prototype._ensureCapacity = function() { | 937 HashMapImplementation.prototype._ensureCapacity = function() { |
| 886 var newNumberOfEntries = this._numberOfEntries + (1); | 938 var newNumberOfEntries = $add(this._numberOfEntries, (1)); |
| 887 if (newNumberOfEntries >= this._loadLimit) { | 939 if (newNumberOfEntries >= this._loadLimit) { |
| 888 this._grow(this._keys.get$length() * (2)); | 940 this._grow(this._keys.get$length() * (2)); |
| 889 return; | 941 return; |
| 890 } | 942 } |
| 891 var capacity = this._keys.get$length(); | 943 var capacity = this._keys.get$length(); |
| 892 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 944 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 893 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 945 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 894 if (this._numberOfDeleted > numberOfFree) { | 946 if (this._numberOfDeleted > numberOfFree) { |
| 895 this._grow(this._keys.get$length()); | 947 this._grow(this._keys.get$length()); |
| 896 } | 948 } |
| 897 } | 949 } |
| 898 HashMapImplementation._isPowerOfTwo = function(x) { | 950 HashMapImplementation._isPowerOfTwo = function(x) { |
| 899 return ((x & (x - (1))) == (0)); | 951 return ((x & (x - (1))) == (0)); |
| 900 } | 952 } |
| 901 HashMapImplementation.prototype._grow = function(newCapacity) { | 953 HashMapImplementation.prototype._grow = function(newCapacity) { |
| 902 var capacity = this._keys.get$length(); | 954 var capacity = this._keys.get$length(); |
| 903 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 955 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 904 var oldKeys = this._keys; | 956 var oldKeys = this._keys; |
| 905 var oldValues = this._values; | 957 var oldValues = this._values; |
| 906 this._keys = new Array(newCapacity); | 958 this._keys = new Array(newCapacity); |
| 907 this._values = new Array(newCapacity); | 959 this._values = new Array(newCapacity); |
| 908 for (var i = (0); | 960 for (var i = (0); |
| 909 i < capacity; i++) { | 961 i < capacity; i++) { |
| 910 var key = oldKeys.$index(i); | 962 var key = oldKeys[i]; |
| 911 if (key == null || key == const$0001) { | 963 if (key == null || key == const$0001) { |
| 912 continue; | 964 continue; |
| 913 } | 965 } |
| 914 var value = oldValues.$index(i); | 966 var value = oldValues[i]; |
| 915 var newIndex = this._probeForAdding(key); | 967 var newIndex = this._probeForAdding(key); |
| 916 this._keys.$setindex(newIndex, key); | 968 this._keys.$setindex(newIndex, key); |
| 917 this._values.$setindex(newIndex, value); | 969 this._values.$setindex(newIndex, value); |
| 918 } | 970 } |
| 919 this._numberOfDeleted = (0); | 971 this._numberOfDeleted = (0); |
| 920 } | 972 } |
| 921 HashMapImplementation.prototype.$setindex = function(key, value) { | 973 HashMapImplementation.prototype.$setindex = function(key, value) { |
| 922 this._ensureCapacity(); | 974 this._ensureCapacity(); |
| 923 var index = this._probeForAdding(key); | 975 var index = this._probeForAdding(key); |
| 924 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { | 976 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 925 this._numberOfEntries++; | 977 this._numberOfEntries++; |
| 926 } | 978 } |
| 927 this._keys.$setindex(index, key); | 979 this._keys.$setindex(index, key); |
| 928 this._values.$setindex(index, value); | 980 this._values.$setindex(index, value); |
| 929 } | 981 } |
| 930 HashMapImplementation.prototype.$index = function(key) { | 982 HashMapImplementation.prototype.$index = function(key) { |
| 931 var index = this._probeForLookup(key); | 983 var index = this._probeForLookup(key); |
| 932 if (index < (0)) return null; | 984 if (index < (0)) return null; |
| 933 return this._values.$index(index); | 985 return this._values[index]; |
| 934 } | 986 } |
| 935 HashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { | 987 HashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { |
| 936 var index = this._probeForLookup(key); | 988 var index = this._probeForLookup(key); |
| 937 if (index >= (0)) return this._values.$index(index); | 989 if (index >= (0)) return this._values[index]; |
| 938 var value = ifAbsent(); | 990 var value = ifAbsent.call$0(); |
| 939 this.$setindex(key, value); | 991 this.$setindex(key, value); |
| 940 return value; | 992 return value; |
| 941 } | 993 } |
| 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() { | 994 HashMapImplementation.prototype.isEmpty = function() { |
| 955 return this._numberOfEntries == (0); | 995 return this._numberOfEntries == (0); |
| 956 } | 996 } |
| 957 HashMapImplementation.prototype.get$length = function() { | 997 HashMapImplementation.prototype.get$length = function() { |
| 958 return this._numberOfEntries; | 998 return this._numberOfEntries; |
| 959 } | 999 } |
| 960 HashMapImplementation.prototype.forEach = function(f) { | 1000 HashMapImplementation.prototype.forEach = function(f) { |
| 961 var length = this._keys.get$length(); | 1001 var length = this._keys.get$length(); |
| 962 for (var i = (0); | 1002 for (var i = (0); |
| 963 i < length; i++) { | 1003 i < length; i++) { |
| 964 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ | 1004 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 965 f(this._keys.$index(i), this._values.$index(i)); | 1005 f.call$2(this._keys[i], this._values[i]); |
| 966 } | 1006 } |
| 967 } | 1007 } |
| 968 } | 1008 } |
| 969 HashMapImplementation.prototype.getKeys = function() { | 1009 HashMapImplementation.prototype.getKeys = function() { |
| 970 var list = new Array(this.get$length()); | 1010 var list = new Array(this.get$length()); |
| 971 var i = (0); | 1011 var i = (0); |
| 972 this.forEach(function _(key, value) { | 1012 this.forEach(function _(key, value) { |
| 973 list.$setindex(i++, key); | 1013 list.$setindex(i++, key); |
| 974 } | 1014 } |
| 975 ); | 1015 ); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 987 HashMapImplementation.prototype.containsKey = function(key) { | 1027 HashMapImplementation.prototype.containsKey = function(key) { |
| 988 return (this._probeForLookup(key) != (-1)); | 1028 return (this._probeForLookup(key) != (-1)); |
| 989 } | 1029 } |
| 990 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype.
containsKey; | 1030 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype.
containsKey; |
| 991 HashMapImplementation.prototype.forEach$1 = function($0) { | 1031 HashMapImplementation.prototype.forEach$1 = function($0) { |
| 992 return this.forEach(to$call$2($0)); | 1032 return this.forEach(to$call$2($0)); |
| 993 }; | 1033 }; |
| 994 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; | 1034 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; |
| 995 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; | 1035 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; |
| 996 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm
pty; | 1036 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 ************** | 1037 // ********** Code for HashMapImplementation_E$E ************** |
| 1001 $inherits(HashMapImplementation_E$E, HashMapImplementation); | 1038 $inherits(HashMapImplementation_E$E, HashMapImplementation); |
| 1002 function HashMapImplementation_E$E() { | 1039 function HashMapImplementation_E$E() { |
| 1003 this._numberOfEntries = (0); | 1040 this._numberOfEntries = (0); |
| 1004 this._numberOfDeleted = (0); | 1041 this._numberOfDeleted = (0); |
| 1005 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); | 1042 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); |
| 1006 this._keys = new Array((8)); | 1043 this._keys = new Array((8)); |
| 1007 this._values = new Array((8)); | 1044 this._values = new Array((8)); |
| 1008 } | 1045 } |
| 1009 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { | 1046 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { |
| 1010 return $truncdiv((capacity * (3)), (4)); | 1047 return $truncdiv((capacity * (3)), (4)); |
| 1011 } | 1048 } |
| 1012 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { | 1049 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { |
| 1013 return hashCode & (length - (1)); | 1050 return hashCode & (length - (1)); |
| 1014 } | 1051 } |
| 1015 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 1052 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { |
| 1016 return (currentProbe + numberOfProbes) & (length - (1)); | 1053 return ($add(currentProbe, numberOfProbes)) & (length - (1)); |
| 1017 } | 1054 } |
| 1018 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { | 1055 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { |
| 1019 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1056 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1020 var numberOfProbes = (1); | 1057 var numberOfProbes = (1); |
| 1021 var initialHash = hash; | 1058 var initialHash = hash; |
| 1022 var insertionIndex = (-1); | 1059 var insertionIndex = (-1); |
| 1023 while (true) { | 1060 while (true) { |
| 1024 var existingKey = this._keys.$index(hash); | 1061 var existingKey = this._keys[hash]; |
| 1025 if (existingKey == null) { | 1062 if (existingKey == null) { |
| 1026 if (insertionIndex < (0)) return hash; | 1063 if (insertionIndex < (0)) return hash; |
| 1027 return insertionIndex; | 1064 return insertionIndex; |
| 1028 } | 1065 } |
| 1029 else if ($eq(existingKey, key)) { | 1066 else if ($eq(existingKey, key)) { |
| 1030 return hash; | 1067 return hash; |
| 1031 } | 1068 } |
| 1032 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1069 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1033 insertionIndex = hash; | 1070 insertionIndex = hash; |
| 1034 } | 1071 } |
| 1035 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1072 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1036 } | 1073 } |
| 1037 } | 1074 } |
| 1038 HashMapImplementation_E$E.prototype._probeForLookup = function(key) { | 1075 HashMapImplementation_E$E.prototype._probeForLookup = function(key) { |
| 1039 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1076 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1040 var numberOfProbes = (1); | 1077 var numberOfProbes = (1); |
| 1041 var initialHash = hash; | 1078 var initialHash = hash; |
| 1042 while (true) { | 1079 while (true) { |
| 1043 var existingKey = this._keys.$index(hash); | 1080 var existingKey = this._keys[hash]; |
| 1044 if (existingKey == null) return (-1); | 1081 if (existingKey == null) return (-1); |
| 1045 if ($eq(existingKey, key)) return hash; | 1082 if ($eq(existingKey, key)) return hash; |
| 1046 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1083 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1047 } | 1084 } |
| 1048 } | 1085 } |
| 1049 HashMapImplementation_E$E.prototype._ensureCapacity = function() { | 1086 HashMapImplementation_E$E.prototype._ensureCapacity = function() { |
| 1050 var newNumberOfEntries = this._numberOfEntries + (1); | 1087 var newNumberOfEntries = $add(this._numberOfEntries, (1)); |
| 1051 if (newNumberOfEntries >= this._loadLimit) { | 1088 if (newNumberOfEntries >= this._loadLimit) { |
| 1052 this._grow(this._keys.get$length() * (2)); | 1089 this._grow(this._keys.get$length() * (2)); |
| 1053 return; | 1090 return; |
| 1054 } | 1091 } |
| 1055 var capacity = this._keys.get$length(); | 1092 var capacity = this._keys.get$length(); |
| 1056 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1093 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1057 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1094 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1058 if (this._numberOfDeleted > numberOfFree) { | 1095 if (this._numberOfDeleted > numberOfFree) { |
| 1059 this._grow(this._keys.get$length()); | 1096 this._grow(this._keys.get$length()); |
| 1060 } | 1097 } |
| 1061 } | 1098 } |
| 1062 HashMapImplementation_E$E._isPowerOfTwo = function(x) { | 1099 HashMapImplementation_E$E._isPowerOfTwo = function(x) { |
| 1063 return ((x & (x - (1))) == (0)); | 1100 return ((x & (x - (1))) == (0)); |
| 1064 } | 1101 } |
| 1065 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { | 1102 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { |
| 1066 var capacity = this._keys.get$length(); | 1103 var capacity = this._keys.get$length(); |
| 1067 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1104 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1068 var oldKeys = this._keys; | 1105 var oldKeys = this._keys; |
| 1069 var oldValues = this._values; | 1106 var oldValues = this._values; |
| 1070 this._keys = new Array(newCapacity); | 1107 this._keys = new Array(newCapacity); |
| 1071 this._values = new Array(newCapacity); | 1108 this._values = new Array(newCapacity); |
| 1072 for (var i = (0); | 1109 for (var i = (0); |
| 1073 i < capacity; i++) { | 1110 i < capacity; i++) { |
| 1074 var key = oldKeys.$index(i); | 1111 var key = oldKeys[i]; |
| 1075 if (key == null || key == const$0001) { | 1112 if (key == null || key == const$0001) { |
| 1076 continue; | 1113 continue; |
| 1077 } | 1114 } |
| 1078 var value = oldValues.$index(i); | 1115 var value = oldValues[i]; |
| 1079 var newIndex = this._probeForAdding(key); | 1116 var newIndex = this._probeForAdding(key); |
| 1080 this._keys.$setindex(newIndex, key); | 1117 this._keys.$setindex(newIndex, key); |
| 1081 this._values.$setindex(newIndex, value); | 1118 this._values.$setindex(newIndex, value); |
| 1082 } | 1119 } |
| 1083 this._numberOfDeleted = (0); | 1120 this._numberOfDeleted = (0); |
| 1084 } | 1121 } |
| 1085 HashMapImplementation_E$E.prototype.$setindex = function(key, value) { | 1122 HashMapImplementation_E$E.prototype.$setindex = function(key, value) { |
| 1086 this._ensureCapacity(); | 1123 this._ensureCapacity(); |
| 1087 var index = this._probeForAdding(key); | 1124 var index = this._probeForAdding(key); |
| 1088 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { | 1125 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 1089 this._numberOfEntries++; | 1126 this._numberOfEntries++; |
| 1090 } | 1127 } |
| 1091 this._keys.$setindex(index, key); | 1128 this._keys.$setindex(index, key); |
| 1092 this._values.$setindex(index, value); | 1129 this._values.$setindex(index, value); |
| 1093 } | 1130 } |
| 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() { | 1131 HashMapImplementation_E$E.prototype.isEmpty = function() { |
| 1107 return this._numberOfEntries == (0); | 1132 return this._numberOfEntries == (0); |
| 1108 } | 1133 } |
| 1109 HashMapImplementation_E$E.prototype.forEach = function(f) { | 1134 HashMapImplementation_E$E.prototype.forEach = function(f) { |
| 1110 var length = this._keys.get$length(); | 1135 var length = this._keys.get$length(); |
| 1111 for (var i = (0); | 1136 for (var i = (0); |
| 1112 i < length; i++) { | 1137 i < length; i++) { |
| 1113 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ | 1138 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 1114 f(this._keys.$index(i), this._values.$index(i)); | 1139 f.call$2(this._keys[i], this._values[i]); |
| 1115 } | 1140 } |
| 1116 } | 1141 } |
| 1117 } | 1142 } |
| 1118 HashMapImplementation_E$E.prototype.getKeys = function() { | 1143 HashMapImplementation_E$E.prototype.getKeys = function() { |
| 1119 var list = new Array(this.get$length()); | 1144 var list = new Array(this.get$length()); |
| 1120 var i = (0); | 1145 var i = (0); |
| 1121 this.forEach(function _(key, value) { | 1146 this.forEach(function _(key, value) { |
| 1122 list.$setindex(i++, key); | 1147 list.$setindex(i++, key); |
| 1123 } | 1148 } |
| 1124 ); | 1149 ); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1139 this._keys = new Array((8)); | 1164 this._keys = new Array((8)); |
| 1140 this._values = new Array((8)); | 1165 this._values = new Array((8)); |
| 1141 } | 1166 } |
| 1142 HashMapImplementation_K$V._computeLoadLimit = function(capacity) { | 1167 HashMapImplementation_K$V._computeLoadLimit = function(capacity) { |
| 1143 return $truncdiv((capacity * (3)), (4)); | 1168 return $truncdiv((capacity * (3)), (4)); |
| 1144 } | 1169 } |
| 1145 HashMapImplementation_K$V._firstProbe = function(hashCode, length) { | 1170 HashMapImplementation_K$V._firstProbe = function(hashCode, length) { |
| 1146 return hashCode & (length - (1)); | 1171 return hashCode & (length - (1)); |
| 1147 } | 1172 } |
| 1148 HashMapImplementation_K$V._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 1173 HashMapImplementation_K$V._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { |
| 1149 return (currentProbe + numberOfProbes) & (length - (1)); | 1174 return ($add(currentProbe, numberOfProbes)) & (length - (1)); |
| 1150 } | 1175 } |
| 1151 HashMapImplementation_K$V.prototype._probeForAdding = function(key) { | 1176 HashMapImplementation_K$V.prototype._probeForAdding = function(key) { |
| 1152 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1177 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1153 var numberOfProbes = (1); | 1178 var numberOfProbes = (1); |
| 1154 var initialHash = hash; | 1179 var initialHash = hash; |
| 1155 var insertionIndex = (-1); | 1180 var insertionIndex = (-1); |
| 1156 while (true) { | 1181 while (true) { |
| 1157 var existingKey = this._keys.$index(hash); | 1182 var existingKey = this._keys[hash]; |
| 1158 if (existingKey == null) { | 1183 if (existingKey == null) { |
| 1159 if (insertionIndex < (0)) return hash; | 1184 if (insertionIndex < (0)) return hash; |
| 1160 return insertionIndex; | 1185 return insertionIndex; |
| 1161 } | 1186 } |
| 1162 else if ($eq(existingKey, key)) { | 1187 else if ($eq(existingKey, key)) { |
| 1163 return hash; | 1188 return hash; |
| 1164 } | 1189 } |
| 1165 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1190 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1166 insertionIndex = hash; | 1191 insertionIndex = hash; |
| 1167 } | 1192 } |
| 1168 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1193 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1169 } | 1194 } |
| 1170 } | 1195 } |
| 1171 HashMapImplementation_K$V.prototype._probeForLookup = function(key) { | 1196 HashMapImplementation_K$V.prototype._probeForLookup = function(key) { |
| 1172 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1197 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1173 var numberOfProbes = (1); | 1198 var numberOfProbes = (1); |
| 1174 var initialHash = hash; | 1199 var initialHash = hash; |
| 1175 while (true) { | 1200 while (true) { |
| 1176 var existingKey = this._keys.$index(hash); | 1201 var existingKey = this._keys[hash]; |
| 1177 if (existingKey == null) return (-1); | 1202 if (existingKey == null) return (-1); |
| 1178 if ($eq(existingKey, key)) return hash; | 1203 if ($eq(existingKey, key)) return hash; |
| 1179 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1204 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1180 } | 1205 } |
| 1181 } | 1206 } |
| 1182 HashMapImplementation_K$V.prototype._ensureCapacity = function() { | 1207 HashMapImplementation_K$V.prototype._ensureCapacity = function() { |
| 1183 var newNumberOfEntries = this._numberOfEntries + (1); | 1208 var newNumberOfEntries = $add(this._numberOfEntries, (1)); |
| 1184 if (newNumberOfEntries >= this._loadLimit) { | 1209 if (newNumberOfEntries >= this._loadLimit) { |
| 1185 this._grow(this._keys.get$length() * (2)); | 1210 this._grow(this._keys.get$length() * (2)); |
| 1186 return; | 1211 return; |
| 1187 } | 1212 } |
| 1188 var capacity = this._keys.get$length(); | 1213 var capacity = this._keys.get$length(); |
| 1189 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1214 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1190 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1215 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1191 if (this._numberOfDeleted > numberOfFree) { | 1216 if (this._numberOfDeleted > numberOfFree) { |
| 1192 this._grow(this._keys.get$length()); | 1217 this._grow(this._keys.get$length()); |
| 1193 } | 1218 } |
| 1194 } | 1219 } |
| 1195 HashMapImplementation_K$V._isPowerOfTwo = function(x) { | 1220 HashMapImplementation_K$V._isPowerOfTwo = function(x) { |
| 1196 return ((x & (x - (1))) == (0)); | 1221 return ((x & (x - (1))) == (0)); |
| 1197 } | 1222 } |
| 1198 HashMapImplementation_K$V.prototype._grow = function(newCapacity) { | 1223 HashMapImplementation_K$V.prototype._grow = function(newCapacity) { |
| 1199 var capacity = this._keys.get$length(); | 1224 var capacity = this._keys.get$length(); |
| 1200 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1225 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1201 var oldKeys = this._keys; | 1226 var oldKeys = this._keys; |
| 1202 var oldValues = this._values; | 1227 var oldValues = this._values; |
| 1203 this._keys = new Array(newCapacity); | 1228 this._keys = new Array(newCapacity); |
| 1204 this._values = new Array(newCapacity); | 1229 this._values = new Array(newCapacity); |
| 1205 for (var i = (0); | 1230 for (var i = (0); |
| 1206 i < capacity; i++) { | 1231 i < capacity; i++) { |
| 1207 var key = oldKeys.$index(i); | 1232 var key = oldKeys[i]; |
| 1208 if (key == null || key == const$0001) { | 1233 if (key == null || key == const$0001) { |
| 1209 continue; | 1234 continue; |
| 1210 } | 1235 } |
| 1211 var value = oldValues.$index(i); | 1236 var value = oldValues[i]; |
| 1212 var newIndex = this._probeForAdding(key); | 1237 var newIndex = this._probeForAdding(key); |
| 1213 this._keys.$setindex(newIndex, key); | 1238 this._keys.$setindex(newIndex, key); |
| 1214 this._values.$setindex(newIndex, value); | 1239 this._values.$setindex(newIndex, value); |
| 1215 } | 1240 } |
| 1216 this._numberOfDeleted = (0); | 1241 this._numberOfDeleted = (0); |
| 1217 } | 1242 } |
| 1218 HashMapImplementation_K$V.prototype.$setindex = function(key, value) { | 1243 HashMapImplementation_K$V.prototype.$setindex = function(key, value) { |
| 1219 this._ensureCapacity(); | 1244 this._ensureCapacity(); |
| 1220 var index = this._probeForAdding(key); | 1245 var index = this._probeForAdding(key); |
| 1221 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { | 1246 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 1222 this._numberOfEntries++; | 1247 this._numberOfEntries++; |
| 1223 } | 1248 } |
| 1224 this._keys.$setindex(index, key); | 1249 this._keys.$setindex(index, key); |
| 1225 this._values.$setindex(index, value); | 1250 this._values.$setindex(index, value); |
| 1226 } | 1251 } |
| 1227 HashMapImplementation_K$V.prototype.$index = function(key) { | 1252 HashMapImplementation_K$V.prototype.$index = function(key) { |
| 1228 var index = this._probeForLookup(key); | 1253 var index = this._probeForLookup(key); |
| 1229 if (index < (0)) return null; | 1254 if (index < (0)) return null; |
| 1230 return this._values.$index(index); | 1255 return this._values[index]; |
| 1231 } | 1256 } |
| 1232 HashMapImplementation_K$V.prototype.putIfAbsent = function(key, ifAbsent) { | 1257 HashMapImplementation_K$V.prototype.putIfAbsent = function(key, ifAbsent) { |
| 1233 var index = this._probeForLookup(key); | 1258 var index = this._probeForLookup(key); |
| 1234 if (index >= (0)) return this._values.$index(index); | 1259 if (index >= (0)) return this._values[index]; |
| 1235 var value = ifAbsent(); | 1260 var value = ifAbsent.call$0(); |
| 1236 this.$setindex(key, value); | 1261 this.$setindex(key, value); |
| 1237 return value; | 1262 return value; |
| 1238 } | 1263 } |
| 1239 HashMapImplementation_K$V.prototype.isEmpty = function() { | 1264 HashMapImplementation_K$V.prototype.isEmpty = function() { |
| 1240 return this._numberOfEntries == (0); | 1265 return this._numberOfEntries == (0); |
| 1241 } | 1266 } |
| 1242 HashMapImplementation_K$V.prototype.forEach = function(f) { | 1267 HashMapImplementation_K$V.prototype.forEach = function(f) { |
| 1243 var length = this._keys.get$length(); | 1268 var length = this._keys.get$length(); |
| 1244 for (var i = (0); | 1269 for (var i = (0); |
| 1245 i < length; i++) { | 1270 i < length; i++) { |
| 1246 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ | 1271 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 1247 f(this._keys.$index(i), this._values.$index(i)); | 1272 f.call$2(this._keys[i], this._values[i]); |
| 1248 } | 1273 } |
| 1249 } | 1274 } |
| 1250 } | 1275 } |
| 1251 HashMapImplementation_K$V.prototype.getKeys = function() { | 1276 HashMapImplementation_K$V.prototype.getKeys = function() { |
| 1252 var list = new Array(this.get$length()); | 1277 var list = new Array(this.get$length()); |
| 1253 var i = (0); | 1278 var i = (0); |
| 1254 this.forEach(function _(key, value) { | 1279 this.forEach(function _(key, value) { |
| 1255 list.$setindex(i++, key); | 1280 list.$setindex(i++, key); |
| 1256 } | 1281 } |
| 1257 ); | 1282 ); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1278 this._keys = new Array((8)); | 1303 this._keys = new Array((8)); |
| 1279 this._values = new Array((8)); | 1304 this._values = new Array((8)); |
| 1280 } | 1305 } |
| 1281 HashMapImplementation_dart_core_String$VariableValue._computeLoadLimit = functio
n(capacity) { | 1306 HashMapImplementation_dart_core_String$VariableValue._computeLoadLimit = functio
n(capacity) { |
| 1282 return $truncdiv((capacity * (3)), (4)); | 1307 return $truncdiv((capacity * (3)), (4)); |
| 1283 } | 1308 } |
| 1284 HashMapImplementation_dart_core_String$VariableValue._firstProbe = function(hash
Code, length) { | 1309 HashMapImplementation_dart_core_String$VariableValue._firstProbe = function(hash
Code, length) { |
| 1285 return hashCode & (length - (1)); | 1310 return hashCode & (length - (1)); |
| 1286 } | 1311 } |
| 1287 HashMapImplementation_dart_core_String$VariableValue._nextProbe = function(curre
ntProbe, numberOfProbes, length) { | 1312 HashMapImplementation_dart_core_String$VariableValue._nextProbe = function(curre
ntProbe, numberOfProbes, length) { |
| 1288 return (currentProbe + numberOfProbes) & (length - (1)); | 1313 return ($add(currentProbe, numberOfProbes)) & (length - (1)); |
| 1289 } | 1314 } |
| 1290 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForAdding =
function(key) { | 1315 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForAdding =
function(key) { |
| 1291 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); | 1316 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); |
| 1292 var numberOfProbes = (1); | 1317 var numberOfProbes = (1); |
| 1293 var initialHash = hash; | 1318 var initialHash = hash; |
| 1294 var insertionIndex = (-1); | 1319 var insertionIndex = (-1); |
| 1295 while (true) { | 1320 while (true) { |
| 1296 var existingKey = this._keys.$index(hash); | 1321 var existingKey = this._keys[hash]; |
| 1297 if (existingKey == null) { | 1322 if (existingKey == null) { |
| 1298 if (insertionIndex < (0)) return hash; | 1323 if (insertionIndex < (0)) return hash; |
| 1299 return insertionIndex; | 1324 return insertionIndex; |
| 1300 } | 1325 } |
| 1301 else if ($eq(existingKey, key)) { | 1326 else if ($eq(existingKey, key)) { |
| 1302 return hash; | 1327 return hash; |
| 1303 } | 1328 } |
| 1304 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1329 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1305 insertionIndex = hash; | 1330 insertionIndex = hash; |
| 1306 } | 1331 } |
| 1307 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1332 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1308 } | 1333 } |
| 1309 } | 1334 } |
| 1310 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForLookup =
function(key) { | 1335 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForLookup =
function(key) { |
| 1311 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); | 1336 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); |
| 1312 var numberOfProbes = (1); | 1337 var numberOfProbes = (1); |
| 1313 var initialHash = hash; | 1338 var initialHash = hash; |
| 1314 while (true) { | 1339 while (true) { |
| 1315 var existingKey = this._keys.$index(hash); | 1340 var existingKey = this._keys[hash]; |
| 1316 if (existingKey == null) return (-1); | 1341 if (existingKey == null) return (-1); |
| 1317 if ($eq(existingKey, key)) return hash; | 1342 if ($eq(existingKey, key)) return hash; |
| 1318 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1343 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1319 } | 1344 } |
| 1320 } | 1345 } |
| 1321 HashMapImplementation_dart_core_String$VariableValue.prototype._ensureCapacity =
function() { | 1346 HashMapImplementation_dart_core_String$VariableValue.prototype._ensureCapacity =
function() { |
| 1322 var newNumberOfEntries = this._numberOfEntries + (1); | 1347 var newNumberOfEntries = $add(this._numberOfEntries, (1)); |
| 1323 if (newNumberOfEntries >= this._loadLimit) { | 1348 if (newNumberOfEntries >= this._loadLimit) { |
| 1324 this._grow(this._keys.get$length() * (2)); | 1349 this._grow(this._keys.get$length() * (2)); |
| 1325 return; | 1350 return; |
| 1326 } | 1351 } |
| 1327 var capacity = this._keys.get$length(); | 1352 var capacity = this._keys.get$length(); |
| 1328 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1353 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1329 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1354 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1330 if (this._numberOfDeleted > numberOfFree) { | 1355 if (this._numberOfDeleted > numberOfFree) { |
| 1331 this._grow(this._keys.get$length()); | 1356 this._grow(this._keys.get$length()); |
| 1332 } | 1357 } |
| 1333 } | 1358 } |
| 1334 HashMapImplementation_dart_core_String$VariableValue._isPowerOfTwo = function(x)
{ | 1359 HashMapImplementation_dart_core_String$VariableValue._isPowerOfTwo = function(x)
{ |
| 1335 return ((x & (x - (1))) == (0)); | 1360 return ((x & (x - (1))) == (0)); |
| 1336 } | 1361 } |
| 1337 HashMapImplementation_dart_core_String$VariableValue.prototype._grow = function(
newCapacity) { | 1362 HashMapImplementation_dart_core_String$VariableValue.prototype._grow = function(
newCapacity) { |
| 1338 var capacity = this._keys.get$length(); | 1363 var capacity = this._keys.get$length(); |
| 1339 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1364 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1340 var oldKeys = this._keys; | 1365 var oldKeys = this._keys; |
| 1341 var oldValues = this._values; | 1366 var oldValues = this._values; |
| 1342 this._keys = new Array(newCapacity); | 1367 this._keys = new Array(newCapacity); |
| 1343 this._values = new Array(newCapacity); | 1368 this._values = new Array(newCapacity); |
| 1344 for (var i = (0); | 1369 for (var i = (0); |
| 1345 i < capacity; i++) { | 1370 i < capacity; i++) { |
| 1346 var key = oldKeys.$index(i); | 1371 var key = oldKeys[i]; |
| 1347 if (key == null || key == const$0001) { | 1372 if (key == null || key == const$0001) { |
| 1348 continue; | 1373 continue; |
| 1349 } | 1374 } |
| 1350 var value = oldValues.$index(i); | 1375 var value = oldValues[i]; |
| 1351 var newIndex = this._probeForAdding(key); | 1376 var newIndex = this._probeForAdding(key); |
| 1352 this._keys.$setindex(newIndex, key); | 1377 this._keys.$setindex(newIndex, key); |
| 1353 this._values.$setindex(newIndex, value); | 1378 this._values.$setindex(newIndex, value); |
| 1354 } | 1379 } |
| 1355 this._numberOfDeleted = (0); | 1380 this._numberOfDeleted = (0); |
| 1356 } | 1381 } |
| 1357 HashMapImplementation_dart_core_String$VariableValue.prototype.$setindex = funct
ion(key, value) { | 1382 HashMapImplementation_dart_core_String$VariableValue.prototype.$setindex = funct
ion(key, value) { |
| 1358 this._ensureCapacity(); | 1383 this._ensureCapacity(); |
| 1359 var index = this._probeForAdding(key); | 1384 var index = this._probeForAdding(key); |
| 1360 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { | 1385 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { |
| 1361 this._numberOfEntries++; | 1386 this._numberOfEntries++; |
| 1362 } | 1387 } |
| 1363 this._keys.$setindex(index, key); | 1388 this._keys.$setindex(index, key); |
| 1364 this._values.$setindex(index, value); | 1389 this._values.$setindex(index, value); |
| 1365 } | 1390 } |
| 1366 HashMapImplementation_dart_core_String$VariableValue.prototype.$index = function
(key) { | 1391 HashMapImplementation_dart_core_String$VariableValue.prototype.$index = function
(key) { |
| 1367 var index = this._probeForLookup(key); | 1392 var index = this._probeForLookup(key); |
| 1368 if (index < (0)) return null; | 1393 if (index < (0)) return null; |
| 1369 return this._values.$index(index); | 1394 return this._values[index]; |
| 1370 } | 1395 } |
| 1371 HashMapImplementation_dart_core_String$VariableValue.prototype.forEach = functio
n(f) { | 1396 HashMapImplementation_dart_core_String$VariableValue.prototype.forEach = functio
n(f) { |
| 1372 var length = this._keys.get$length(); | 1397 var length = this._keys.get$length(); |
| 1373 for (var i = (0); | 1398 for (var i = (0); |
| 1374 i < length; i++) { | 1399 i < length; i++) { |
| 1375 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ | 1400 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { |
| 1376 f(this._keys.$index(i), this._values.$index(i)); | 1401 f.call$2(this._keys[i], this._values[i]); |
| 1377 } | 1402 } |
| 1378 } | 1403 } |
| 1379 } | 1404 } |
| 1380 HashMapImplementation_dart_core_String$VariableValue.prototype.containsKey = fun
ction(key) { | 1405 HashMapImplementation_dart_core_String$VariableValue.prototype.containsKey = fun
ction(key) { |
| 1381 return (this._probeForLookup(key) != (-1)); | 1406 return (this._probeForLookup(key) != (-1)); |
| 1382 } | 1407 } |
| 1383 // ********** Code for HashSetImplementation ************** | 1408 // ********** Code for HashSetImplementation ************** |
| 1384 function HashSetImplementation() { | 1409 function HashSetImplementation() { |
| 1385 this._backingMap = new HashMapImplementation_E$E(); | 1410 this._backingMap = new HashMapImplementation_E$E(); |
| 1386 } | 1411 } |
| 1387 HashSetImplementation.HashSetImplementation$from$factory = function(other) { | 1412 HashSetImplementation.HashSetImplementation$from$factory = function(other) { |
| 1388 var set = new HashSetImplementation_E(); | 1413 var set = new HashSetImplementation_E(); |
| 1389 for (var $$i = other.iterator$0(); $$i.hasNext$0(); ) { | 1414 for (var $$i = other.iterator$0(); $$i.hasNext$0(); ) { |
| 1390 var e = $$i.next$0(); | 1415 var e = $$i.next$0(); |
| 1391 set.add(e); | 1416 set.add(e); |
| 1392 } | 1417 } |
| 1393 return set; | 1418 return set; |
| 1394 } | 1419 } |
| 1395 HashSetImplementation.prototype.add = function(value) { | 1420 HashSetImplementation.prototype.add = function(value) { |
| 1396 this._backingMap.$setindex(value, value); | 1421 this._backingMap.$setindex(value, value); |
| 1397 } | 1422 } |
| 1398 HashSetImplementation.prototype.contains = function(value) { | 1423 HashSetImplementation.prototype.contains = function(value) { |
| 1399 return this._backingMap.containsKey(value); | 1424 return this._backingMap.containsKey(value); |
| 1400 } | 1425 } |
| 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) { | 1426 HashSetImplementation.prototype.addAll = function(collection) { |
| 1407 var $this = this; // closure support | 1427 var $this = this; // closure support |
| 1408 collection.forEach(function _(value) { | 1428 collection.forEach(function _(value) { |
| 1409 $this.add(value); | 1429 $this.add(value); |
| 1410 } | 1430 } |
| 1411 ); | 1431 ); |
| 1412 } | 1432 } |
| 1413 HashSetImplementation.prototype.forEach = function(f) { | 1433 HashSetImplementation.prototype.forEach = function(f) { |
| 1414 this._backingMap.forEach(function _(key, value) { | 1434 this._backingMap.forEach(function _(key, value) { |
| 1415 f(key); | 1435 f.call$1(key); |
| 1416 } | 1436 } |
| 1417 ); | 1437 ); |
| 1418 } | 1438 } |
| 1419 HashSetImplementation.prototype.filter = function(f) { | 1439 HashSetImplementation.prototype.filter = function(f) { |
| 1420 var result = new HashSetImplementation(); | 1440 var result = new HashSetImplementation(); |
| 1421 this._backingMap.forEach(function _(key, value) { | 1441 this._backingMap.forEach(function _(key, value) { |
| 1422 if (f(key)) result.add(key); | 1442 if (f.call$1(key)) result.add(key); |
| 1423 } | 1443 } |
| 1424 ); | 1444 ); |
| 1425 return result; | 1445 return result; |
| 1426 } | 1446 } |
| 1427 HashSetImplementation.prototype.every = function(f) { | 1447 HashSetImplementation.prototype.every = function(f) { |
| 1428 var keys = this._backingMap.getKeys(); | 1448 var keys = this._backingMap.getKeys(); |
| 1429 return keys.every(f); | 1449 return keys.every(f); |
| 1430 } | 1450 } |
| 1431 HashSetImplementation.prototype.some = function(f) { | 1451 HashSetImplementation.prototype.some = function(f) { |
| 1432 var keys = this._backingMap.getKeys(); | 1452 var keys = this._backingMap.getKeys(); |
| 1433 return keys.some(f); | 1453 return keys.some(f); |
| 1434 } | 1454 } |
| 1435 HashSetImplementation.prototype.isEmpty = function() { | 1455 HashSetImplementation.prototype.isEmpty = function() { |
| 1436 return this._backingMap.isEmpty(); | 1456 return this._backingMap.isEmpty(); |
| 1437 } | 1457 } |
| 1438 HashSetImplementation.prototype.get$length = function() { | 1458 HashSetImplementation.prototype.get$length = function() { |
| 1439 return this._backingMap.get$length(); | 1459 return this._backingMap.get$length(); |
| 1440 } | 1460 } |
| 1441 HashSetImplementation.prototype.iterator = function() { | 1461 HashSetImplementation.prototype.iterator = function() { |
| 1442 return new HashSetIterator_E(this); | 1462 return new HashSetIterator_E(this); |
| 1443 } | 1463 } |
| 1444 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; | 1464 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; |
| 1445 HashSetImplementation.prototype.addAll$1 = HashSetImplementation.prototype.addAl
l; | 1465 HashSetImplementation.prototype.addAll$1 = HashSetImplementation.prototype.addAl
l; |
| 1446 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con
tains; | 1466 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) { | 1467 HashSetImplementation.prototype.filter$1 = function($0) { |
| 1451 return this.filter(to$call$1($0)); | 1468 return this.filter(to$call$1($0)); |
| 1452 }; | 1469 }; |
| 1453 HashSetImplementation.prototype.forEach$1 = function($0) { | 1470 HashSetImplementation.prototype.forEach$1 = function($0) { |
| 1454 return this.forEach(to$call$1($0)); | 1471 return this.forEach(to$call$1($0)); |
| 1455 }; | 1472 }; |
| 1456 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm
pty; | 1473 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm
pty; |
| 1457 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite
rator; | 1474 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 ************** | 1475 // ********** Code for HashSetImplementation_E ************** |
| 1462 $inherits(HashSetImplementation_E, HashSetImplementation); | 1476 $inherits(HashSetImplementation_E, HashSetImplementation); |
| 1463 function HashSetImplementation_E() { | 1477 function HashSetImplementation_E() { |
| 1464 this._backingMap = new HashMapImplementation_E$E(); | 1478 this._backingMap = new HashMapImplementation_E$E(); |
| 1465 } | 1479 } |
| 1466 // ********** Code for HashSetImplementation_Library ************** | 1480 // ********** Code for HashSetImplementation_Library ************** |
| 1467 $inherits(HashSetImplementation_Library, HashSetImplementation); | 1481 $inherits(HashSetImplementation_Library, HashSetImplementation); |
| 1468 function HashSetImplementation_Library() {} | 1482 function HashSetImplementation_Library() {} |
| 1483 // ********** Code for HashSetImplementation_Member ************** |
| 1484 $inherits(HashSetImplementation_Member, HashSetImplementation); |
| 1485 function HashSetImplementation_Member() {} |
| 1469 // ********** Code for HashSetImplementation_dart_core_String ************** | 1486 // ********** Code for HashSetImplementation_dart_core_String ************** |
| 1470 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation); | 1487 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation); |
| 1471 function HashSetImplementation_dart_core_String() {} | 1488 function HashSetImplementation_dart_core_String() {} |
| 1472 // ********** Code for HashSetImplementation_Type ************** | 1489 // ********** Code for HashSetImplementation_Type ************** |
| 1473 $inherits(HashSetImplementation_Type, HashSetImplementation); | 1490 $inherits(HashSetImplementation_Type, HashSetImplementation); |
| 1474 function HashSetImplementation_Type() {} | 1491 function HashSetImplementation_Type() {} |
| 1475 // ********** Code for HashSetIterator ************** | 1492 // ********** Code for HashSetIterator ************** |
| 1476 function HashSetIterator(set_) { | 1493 function HashSetIterator(set_) { |
| 1477 this._entries = set_._backingMap._keys; | 1494 this._entries = set_._backingMap._keys; |
| 1478 this._nextValidIndex = (-1); | 1495 this._nextValidIndex = (-1); |
| 1479 this._advance(); | 1496 this._advance(); |
| 1480 } | 1497 } |
| 1481 HashSetIterator.prototype.hasNext = function() { | 1498 HashSetIterator.prototype.hasNext = function() { |
| 1482 if (this._nextValidIndex >= this._entries.get$length()) return false; | 1499 if (this._nextValidIndex >= this._entries.get$length()) return false; |
| 1483 if (this._entries.$index(this._nextValidIndex) == const$0001) { | 1500 if (this._entries[this._nextValidIndex] == const$0001) { |
| 1484 this._advance(); | 1501 this._advance(); |
| 1485 } | 1502 } |
| 1486 return this._nextValidIndex < this._entries.get$length(); | 1503 return this._nextValidIndex < this._entries.get$length(); |
| 1487 } | 1504 } |
| 1488 HashSetIterator.prototype.next = function() { | 1505 HashSetIterator.prototype.next = function() { |
| 1489 if (!this.hasNext()) { | 1506 if (!this.hasNext()) { |
| 1490 $throw(const$0005); | 1507 $throw(const$0005); |
| 1491 } | 1508 } |
| 1492 var res = this._entries.$index(this._nextValidIndex); | 1509 var res = this._entries[this._nextValidIndex]; |
| 1493 this._advance(); | 1510 this._advance(); |
| 1494 return res; | 1511 return res; |
| 1495 } | 1512 } |
| 1496 HashSetIterator.prototype._advance = function() { | 1513 HashSetIterator.prototype._advance = function() { |
| 1497 var length = this._entries.get$length(); | 1514 var length = this._entries.get$length(); |
| 1498 var entry; | 1515 var entry; |
| 1499 var deletedKey = const$0001; | 1516 var deletedKey = const$0001; |
| 1500 do { | 1517 do { |
| 1501 if (++this._nextValidIndex >= length) break; | 1518 if (++this._nextValidIndex >= length) break; |
| 1502 entry = this._entries.$index(this._nextValidIndex); | 1519 entry = this._entries[this._nextValidIndex]; |
| 1503 } | 1520 } |
| 1504 while ((entry == null) || (entry == deletedKey)) | 1521 while ((entry == null) || (entry == deletedKey)) |
| 1505 } | 1522 } |
| 1506 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; | 1523 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; |
| 1507 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; | 1524 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; |
| 1508 // ********** Code for HashSetIterator_E ************** | 1525 // ********** Code for HashSetIterator_E ************** |
| 1509 $inherits(HashSetIterator_E, HashSetIterator); | 1526 $inherits(HashSetIterator_E, HashSetIterator); |
| 1510 function HashSetIterator_E(set_) { | 1527 function HashSetIterator_E(set_) { |
| 1511 this._nextValidIndex = (-1); | 1528 this._nextValidIndex = (-1); |
| 1512 this._entries = set_._backingMap._keys; | 1529 this._entries = set_._backingMap._keys; |
| 1513 this._advance(); | 1530 this._advance(); |
| 1514 } | 1531 } |
| 1515 HashSetIterator_E.prototype._advance = function() { | 1532 HashSetIterator_E.prototype._advance = function() { |
| 1516 var length = this._entries.get$length(); | 1533 var length = this._entries.get$length(); |
| 1517 var entry; | 1534 var entry; |
| 1518 var deletedKey = const$0001; | 1535 var deletedKey = const$0001; |
| 1519 do { | 1536 do { |
| 1520 if (++this._nextValidIndex >= length) break; | 1537 if (++this._nextValidIndex >= length) break; |
| 1521 entry = this._entries.$index(this._nextValidIndex); | 1538 entry = this._entries[this._nextValidIndex]; |
| 1522 } | 1539 } |
| 1523 while ((entry == null) || (entry == deletedKey)) | 1540 while ((entry == null) || (entry == deletedKey)) |
| 1524 } | 1541 } |
| 1525 // ********** Code for _DeletedKeySentinel ************** | 1542 // ********** Code for _DeletedKeySentinel ************** |
| 1526 function _DeletedKeySentinel() { | 1543 function _DeletedKeySentinel() { |
| 1527 | 1544 |
| 1528 } | 1545 } |
| 1529 // ********** Code for KeyValuePair ************** | 1546 // ********** Code for KeyValuePair ************** |
| 1530 function KeyValuePair(key, value) { | 1547 function KeyValuePair(key, value) { |
| 1531 this.value = value; | 1548 this.value = value; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1554 } | 1571 } |
| 1555 } | 1572 } |
| 1556 LinkedHashMapImplementation.prototype.$index = function(key) { | 1573 LinkedHashMapImplementation.prototype.$index = function(key) { |
| 1557 var entry = this._map.$index(key); | 1574 var entry = this._map.$index(key); |
| 1558 if (entry == null) return null; | 1575 if (entry == null) return null; |
| 1559 return entry.get$element().get$value(); | 1576 return entry.get$element().get$value(); |
| 1560 } | 1577 } |
| 1561 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { | 1578 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { |
| 1562 var value = this.$index(key); | 1579 var value = this.$index(key); |
| 1563 if ((this.$index(key) == null) && !(this.containsKey(key))) { | 1580 if ((this.$index(key) == null) && !(this.containsKey(key))) { |
| 1564 value = ifAbsent(); | 1581 value = ifAbsent.call$0(); |
| 1565 this.$setindex(key, value); | 1582 this.$setindex(key, value); |
| 1566 } | 1583 } |
| 1567 return value; | 1584 return value; |
| 1568 } | 1585 } |
| 1569 LinkedHashMapImplementation.prototype.getKeys = function() { | 1586 LinkedHashMapImplementation.prototype.getKeys = function() { |
| 1570 var list = new Array(this.get$length()); | 1587 var list = new Array(this.get$length()); |
| 1571 var index = (0); | 1588 var index = (0); |
| 1572 this._list.forEach(function _(entry) { | 1589 this._list.forEach(function _(entry) { |
| 1573 list.$setindex(index++, entry.key); | 1590 list.$setindex(index++, entry.key); |
| 1574 } | 1591 } |
| 1575 ); | 1592 ); |
| 1576 return list; | 1593 return list; |
| 1577 } | 1594 } |
| 1578 LinkedHashMapImplementation.prototype.getValues = function() { | 1595 LinkedHashMapImplementation.prototype.getValues = function() { |
| 1579 var list = new Array(this.get$length()); | 1596 var list = new Array(this.get$length()); |
| 1580 var index = (0); | 1597 var index = (0); |
| 1581 this._list.forEach(function _(entry) { | 1598 this._list.forEach(function _(entry) { |
| 1582 list.$setindex(index++, entry.value); | 1599 list.$setindex(index++, entry.value); |
| 1583 } | 1600 } |
| 1584 ); | 1601 ); |
| 1585 return list; | 1602 return list; |
| 1586 } | 1603 } |
| 1587 LinkedHashMapImplementation.prototype.forEach = function(f) { | 1604 LinkedHashMapImplementation.prototype.forEach = function(f) { |
| 1588 this._list.forEach(function _(entry) { | 1605 this._list.forEach(function _(entry) { |
| 1589 f(entry.key, entry.value); | 1606 f.call$2(entry.key, entry.value); |
| 1590 } | 1607 } |
| 1591 ); | 1608 ); |
| 1592 } | 1609 } |
| 1593 LinkedHashMapImplementation.prototype.containsKey = function(key) { | 1610 LinkedHashMapImplementation.prototype.containsKey = function(key) { |
| 1594 return this._map.containsKey(key); | 1611 return this._map.containsKey(key); |
| 1595 } | 1612 } |
| 1596 LinkedHashMapImplementation.prototype.get$length = function() { | 1613 LinkedHashMapImplementation.prototype.get$length = function() { |
| 1597 return this._map.get$length(); | 1614 return this._map.get$length(); |
| 1598 } | 1615 } |
| 1599 LinkedHashMapImplementation.prototype.isEmpty = function() { | 1616 LinkedHashMapImplementation.prototype.isEmpty = function() { |
| 1600 return this.get$length() == (0); | 1617 return this.get$length() == (0); |
| 1601 } | 1618 } |
| 1602 LinkedHashMapImplementation.prototype.containsKey$1 = LinkedHashMapImplementatio
n.prototype.containsKey; | 1619 LinkedHashMapImplementation.prototype.containsKey$1 = LinkedHashMapImplementatio
n.prototype.containsKey; |
| 1603 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { | 1620 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { |
| 1604 return this.forEach(to$call$2($0)); | 1621 return this.forEach(to$call$2($0)); |
| 1605 }; | 1622 }; |
| 1606 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr
ototype.getKeys; | 1623 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr
ototype.getKeys; |
| 1607 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation.
prototype.getValues; | 1624 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation.
prototype.getValues; |
| 1608 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr
ototype.isEmpty; | 1625 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 ************** | 1626 // ********** Code for DoubleLinkedQueueEntry ************** |
| 1613 function DoubleLinkedQueueEntry(e) { | 1627 function DoubleLinkedQueueEntry(e) { |
| 1614 this._element = e; | 1628 this._element = e; |
| 1615 } | 1629 } |
| 1616 DoubleLinkedQueueEntry.prototype._link = function(p, n) { | 1630 DoubleLinkedQueueEntry.prototype._link = function(p, n) { |
| 1617 this._next = n; | 1631 this._next = n; |
| 1618 this._previous = p; | 1632 this._previous = p; |
| 1619 p._next = this; | 1633 p._next = this; |
| 1620 n._previous = this; | 1634 n._previous = this; |
| 1621 } | 1635 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 ); | 1772 ); |
| 1759 return counter; | 1773 return counter; |
| 1760 } | 1774 } |
| 1761 DoubleLinkedQueue.prototype.isEmpty = function() { | 1775 DoubleLinkedQueue.prototype.isEmpty = function() { |
| 1762 return (this._sentinel._next == this._sentinel); | 1776 return (this._sentinel._next == this._sentinel); |
| 1763 } | 1777 } |
| 1764 DoubleLinkedQueue.prototype.forEach = function(f) { | 1778 DoubleLinkedQueue.prototype.forEach = function(f) { |
| 1765 var entry = this._sentinel._next; | 1779 var entry = this._sentinel._next; |
| 1766 while (entry != this._sentinel) { | 1780 while (entry != this._sentinel) { |
| 1767 var nextEntry = entry._next; | 1781 var nextEntry = entry._next; |
| 1768 f(entry._element); | 1782 f.call$1(entry._element); |
| 1769 entry = nextEntry; | 1783 entry = nextEntry; |
| 1770 } | 1784 } |
| 1771 } | 1785 } |
| 1772 DoubleLinkedQueue.prototype.every = function(f) { | 1786 DoubleLinkedQueue.prototype.every = function(f) { |
| 1773 var entry = this._sentinel._next; | 1787 var entry = this._sentinel._next; |
| 1774 while (entry != this._sentinel) { | 1788 while (entry != this._sentinel) { |
| 1775 var nextEntry = entry._next; | 1789 var nextEntry = entry._next; |
| 1776 if (!f(entry._element)) return false; | 1790 if (!f.call$1(entry._element)) return false; |
| 1777 entry = nextEntry; | 1791 entry = nextEntry; |
| 1778 } | 1792 } |
| 1779 return true; | 1793 return true; |
| 1780 } | 1794 } |
| 1781 DoubleLinkedQueue.prototype.some = function(f) { | 1795 DoubleLinkedQueue.prototype.some = function(f) { |
| 1782 var entry = this._sentinel._next; | 1796 var entry = this._sentinel._next; |
| 1783 while (entry != this._sentinel) { | 1797 while (entry != this._sentinel) { |
| 1784 var nextEntry = entry._next; | 1798 var nextEntry = entry._next; |
| 1785 if (f(entry._element)) return true; | 1799 if (f.call$1(entry._element)) return true; |
| 1786 entry = nextEntry; | 1800 entry = nextEntry; |
| 1787 } | 1801 } |
| 1788 return false; | 1802 return false; |
| 1789 } | 1803 } |
| 1790 DoubleLinkedQueue.prototype.filter = function(f) { | 1804 DoubleLinkedQueue.prototype.filter = function(f) { |
| 1791 var other = new DoubleLinkedQueue(); | 1805 var other = new DoubleLinkedQueue(); |
| 1792 var entry = this._sentinel._next; | 1806 var entry = this._sentinel._next; |
| 1793 while (entry != this._sentinel) { | 1807 while (entry != this._sentinel) { |
| 1794 var nextEntry = entry._next; | 1808 var nextEntry = entry._next; |
| 1795 if (f(entry._element)) other.addLast(entry._element); | 1809 if (f.call$1(entry._element)) other.addLast(entry._element); |
| 1796 entry = nextEntry; | 1810 entry = nextEntry; |
| 1797 } | 1811 } |
| 1798 return other; | 1812 return other; |
| 1799 } | 1813 } |
| 1800 DoubleLinkedQueue.prototype.iterator = function() { | 1814 DoubleLinkedQueue.prototype.iterator = function() { |
| 1801 return new _DoubleLinkedQueueIterator_E(this._sentinel); | 1815 return new _DoubleLinkedQueueIterator_E(this._sentinel); |
| 1802 } | 1816 } |
| 1803 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; | 1817 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; |
| 1804 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll; | 1818 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll; |
| 1805 DoubleLinkedQueue.prototype.addLast$1 = DoubleLinkedQueue.prototype.addLast; | 1819 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) { | 1820 DoubleLinkedQueue.prototype.filter$1 = function($0) { |
| 1810 return this.filter(to$call$1($0)); | 1821 return this.filter(to$call$1($0)); |
| 1811 }; | 1822 }; |
| 1812 DoubleLinkedQueue.prototype.forEach$1 = function($0) { | 1823 DoubleLinkedQueue.prototype.forEach$1 = function($0) { |
| 1813 return this.forEach(to$call$1($0)); | 1824 return this.forEach(to$call$1($0)); |
| 1814 }; | 1825 }; |
| 1815 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; | 1826 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; |
| 1816 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; | 1827 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; |
| 1817 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; | 1828 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; | 1829 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 ************** | 1830 // ********** Code for DoubleLinkedQueue_E ************** |
| 1824 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); | 1831 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); |
| 1825 function DoubleLinkedQueue_E() {} | 1832 function DoubleLinkedQueue_E() {} |
| 1826 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** | 1833 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** |
| 1827 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); | 1834 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); |
| 1828 function DoubleLinkedQueue_KeyValuePair_K$V() { | 1835 function DoubleLinkedQueue_KeyValuePair_K$V() { |
| 1829 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); | 1836 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); |
| 1830 } | 1837 } |
| 1831 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { | 1838 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { |
| 1832 this._sentinel.prepend(value); | 1839 this._sentinel.prepend(value); |
| 1833 } | 1840 } |
| 1834 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { | 1841 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { |
| 1835 return this._sentinel.previousEntry(); | 1842 return this._sentinel.previousEntry(); |
| 1836 } | 1843 } |
| 1837 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { | 1844 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { |
| 1838 var entry = this._sentinel._next; | 1845 var entry = this._sentinel._next; |
| 1839 while (entry != this._sentinel) { | 1846 while (entry != this._sentinel) { |
| 1840 var nextEntry = entry._next; | 1847 var nextEntry = entry._next; |
| 1841 f(entry._element); | 1848 f.call$1(entry._element); |
| 1842 entry = nextEntry; | 1849 entry = nextEntry; |
| 1843 } | 1850 } |
| 1844 } | 1851 } |
| 1845 // ********** Code for _DoubleLinkedQueueIterator ************** | 1852 // ********** Code for _DoubleLinkedQueueIterator ************** |
| 1846 function _DoubleLinkedQueueIterator(_sentinel) { | 1853 function _DoubleLinkedQueueIterator(_sentinel) { |
| 1847 this._sentinel = _sentinel; | 1854 this._sentinel = _sentinel; |
| 1848 this._currentEntry = this._sentinel; | 1855 this._currentEntry = this._sentinel; |
| 1849 } | 1856 } |
| 1850 _DoubleLinkedQueueIterator.prototype.hasNext = function() { | 1857 _DoubleLinkedQueueIterator.prototype.hasNext = function() { |
| 1851 return this._currentEntry._next != this._sentinel; | 1858 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() { | 1920 StringBufferImpl.prototype.get$length = function() { |
| 1914 return this._length; | 1921 return this._length; |
| 1915 } | 1922 } |
| 1916 StringBufferImpl.prototype.isEmpty = function() { | 1923 StringBufferImpl.prototype.isEmpty = function() { |
| 1917 return this._length == (0); | 1924 return this._length == (0); |
| 1918 } | 1925 } |
| 1919 StringBufferImpl.prototype.add = function(obj) { | 1926 StringBufferImpl.prototype.add = function(obj) { |
| 1920 var str = obj.toString$0(); | 1927 var str = obj.toString$0(); |
| 1921 if (str == null || str.isEmpty()) return this; | 1928 if (str == null || str.isEmpty()) return this; |
| 1922 this._buffer.add(str); | 1929 this._buffer.add(str); |
| 1923 this._length += str.length; | 1930 this._length = $add(this._length, str.length); |
| 1924 return this; | 1931 return this; |
| 1925 } | 1932 } |
| 1926 StringBufferImpl.prototype.addAll = function(objects) { | 1933 StringBufferImpl.prototype.addAll = function(objects) { |
| 1927 for (var $$i = objects.iterator$0(); $$i.hasNext$0(); ) { | 1934 for (var $$i = objects.iterator$0(); $$i.hasNext$0(); ) { |
| 1928 var obj = $$i.next$0(); | 1935 var obj = $$i.next$0(); |
| 1929 this.add(obj); | 1936 this.add(obj); |
| 1930 } | 1937 } |
| 1931 return this; | 1938 return this; |
| 1932 } | 1939 } |
| 1933 StringBufferImpl.prototype.clear = function() { | 1940 StringBufferImpl.prototype.clear = function() { |
| 1934 this._buffer = new Array(); | 1941 this._buffer = new Array(); |
| 1935 this._length = (0); | 1942 this._length = (0); |
| 1936 return this; | 1943 return this; |
| 1937 } | 1944 } |
| 1938 StringBufferImpl.prototype.toString = function() { | 1945 StringBufferImpl.prototype.toString = function() { |
| 1939 if (this._buffer.get$length() == (0)) return ""; | 1946 if (this._buffer.get$length() == (0)) return ""; |
| 1940 if (this._buffer.get$length() == (1)) return this._buffer.$index((0)); | 1947 if (this._buffer.get$length() == (1)) return this._buffer[(0)]; |
| 1941 var result = StringBase.concatAll(this._buffer); | 1948 var result = StringBase.concatAll(this._buffer); |
| 1942 this._buffer.clear(); | 1949 this._buffer.clear(); |
| 1943 this._buffer.add(result); | 1950 this._buffer.add(result); |
| 1944 return result; | 1951 return result; |
| 1945 } | 1952 } |
| 1946 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; | 1953 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; |
| 1947 StringBufferImpl.prototype.addAll$1 = StringBufferImpl.prototype.addAll; | 1954 StringBufferImpl.prototype.addAll$1 = StringBufferImpl.prototype.addAll; |
| 1948 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; | 1955 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; |
| 1949 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; | 1956 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; |
| 1950 // ********** Code for StringBase ************** | 1957 // ********** Code for StringBase ************** |
| 1951 function StringBase() {} | 1958 function StringBase() {} |
| 1952 StringBase.createFromCharCodes = function(charCodes) { | 1959 StringBase.createFromCharCodes = function(charCodes) { |
| 1953 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { | 1960 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { |
| 1954 charCodes = new ListFactory.ListFactory$from$factory(charCodes); | 1961 charCodes = new ListFactory.ListFactory$from$factory(charCodes); |
| 1955 } | 1962 } |
| 1956 return String.fromCharCode.apply(null, charCodes); | 1963 return String.fromCharCode.apply(null, charCodes); |
| 1957 } | 1964 } |
| 1958 StringBase.join = function(strings, separator) { | 1965 StringBase.join = function(strings, separator) { |
| 1959 if (strings.get$length() == (0)) return ""; | 1966 if (strings.get$length() == (0)) return ""; |
| 1960 var s = strings.$index((0)); | 1967 var s = strings[(0)]; |
| 1961 for (var i = (1); | 1968 for (var i = (1); |
| 1962 i < strings.get$length(); i++) { | 1969 i < strings.get$length(); i++) { |
| 1963 s = s + separator + strings.$index(i); | 1970 s = s + separator + strings[i]; |
| 1964 } | 1971 } |
| 1965 return s; | 1972 return s; |
| 1966 } | 1973 } |
| 1967 StringBase.concatAll = function(strings) { | 1974 StringBase.concatAll = function(strings) { |
| 1968 return StringBase.join(strings, ""); | 1975 return StringBase.join(strings, ""); |
| 1969 } | 1976 } |
| 1970 // ********** Code for StringImplementation ************** | 1977 // ********** Code for StringImplementation ************** |
| 1971 StringImplementation = String; | 1978 StringImplementation = String; |
| 1972 StringImplementation.prototype.get$length = function() { return this.length; }; | 1979 StringImplementation.prototype.get$length = function() { return this.length; }; |
| 1973 StringImplementation.prototype.endsWith = function(other) { | 1980 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; | 2052 StringImplementation.prototype.isEmpty$0 = StringImplementation.prototype.isEmpt
y; |
| 2046 StringImplementation.prototype.replaceFirst$2 = StringImplementation.prototype.r
eplaceFirst; | 2053 StringImplementation.prototype.replaceFirst$2 = StringImplementation.prototype.r
eplaceFirst; |
| 2047 StringImplementation.prototype.startsWith$1 = StringImplementation.prototype.sta
rtsWith; | 2054 StringImplementation.prototype.startsWith$1 = StringImplementation.prototype.sta
rtsWith; |
| 2048 StringImplementation.prototype.substring$1 = StringImplementation.prototype.subs
tring; | 2055 StringImplementation.prototype.substring$1 = StringImplementation.prototype.subs
tring; |
| 2049 StringImplementation.prototype.substring$2 = StringImplementation.prototype.subs
tring; | 2056 StringImplementation.prototype.substring$2 = StringImplementation.prototype.subs
tring; |
| 2050 // ********** Code for Collections ************** | 2057 // ********** Code for Collections ************** |
| 2051 function Collections() {} | 2058 function Collections() {} |
| 2052 Collections.forEach = function(iterable, f) { | 2059 Collections.forEach = function(iterable, f) { |
| 2053 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2060 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2054 var e = $$i.next$0(); | 2061 var e = $$i.next$0(); |
| 2055 f(e); | 2062 f.call$1(e); |
| 2056 } | 2063 } |
| 2057 } | 2064 } |
| 2058 Collections.some = function(iterable, f) { | 2065 Collections.some = function(iterable, f) { |
| 2059 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2066 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2060 var e = $$i.next$0(); | 2067 var e = $$i.next$0(); |
| 2061 if (f(e)) return true; | 2068 if (f.call$1(e)) return true; |
| 2062 } | 2069 } |
| 2063 return false; | 2070 return false; |
| 2064 } | 2071 } |
| 2065 Collections.every = function(iterable, f) { | 2072 Collections.every = function(iterable, f) { |
| 2066 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2073 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2067 var e = $$i.next$0(); | 2074 var e = $$i.next$0(); |
| 2068 if (!f(e)) return false; | 2075 if (!f.call$1(e)) return false; |
| 2069 } | 2076 } |
| 2070 return true; | 2077 return true; |
| 2071 } | 2078 } |
| 2072 Collections.filter = function(source, destination, f) { | 2079 Collections.filter = function(source, destination, f) { |
| 2073 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { | 2080 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { |
| 2074 var e = $$i.next$0(); | 2081 var e = $$i.next$0(); |
| 2075 if (f(e)) destination.add(e); | 2082 if (f.call$1(e)) destination.add(e); |
| 2076 } | 2083 } |
| 2077 return destination; | 2084 return destination; |
| 2078 } | 2085 } |
| 2079 // ********** Code for _Worker ************** | 2086 // ********** Code for _Worker ************** |
| 2080 // ********** Code for _ArgumentMismatchException ************** | 2087 // ********** Code for _ArgumentMismatchException ************** |
| 2081 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException); | 2088 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException); |
| 2082 function _ArgumentMismatchException(_message) { | 2089 function _ArgumentMismatchException(_message) { |
| 2083 this._dart_coreimpl_message = _message; | 2090 this._dart_coreimpl_message = _message; |
| 2084 ClosureArgumentMismatchException.call(this); | 2091 ClosureArgumentMismatchException.call(this); |
| 2085 } | 2092 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 // TODO(jmesserly): evaluate the performance of these stubs. | 2158 // TODO(jmesserly): evaluate the performance of these stubs. |
| 2152 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}'; | 2159 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}'; |
| 2153 return new Function('$f', 'return ' + f + '').call(null, this); | 2160 return new Function('$f', 'return ' + f + '').call(null, this); |
| 2154 | 2161 |
| 2155 } | 2162 } |
| 2156 // ********** Code for top level ************** | 2163 // ********** Code for top level ************** |
| 2157 function _map(itemsAndKeys) { | 2164 function _map(itemsAndKeys) { |
| 2158 var ret = new LinkedHashMapImplementation(); | 2165 var ret = new LinkedHashMapImplementation(); |
| 2159 for (var i = (0); | 2166 for (var i = (0); |
| 2160 i < itemsAndKeys.get$length(); ) { | 2167 i < itemsAndKeys.get$length(); ) { |
| 2161 ret.$setindex(itemsAndKeys.$index(i++), itemsAndKeys.$index(i++)); | 2168 ret.$setindex(itemsAndKeys[i++], itemsAndKeys[i++]); |
| 2162 } | 2169 } |
| 2163 return ret; | 2170 return ret; |
| 2164 } | 2171 } |
| 2165 // ********** Library node ************** | 2172 // ********** Library node ************** |
| 2166 // ********** Code for Process ************** | 2173 // ********** Code for Process ************** |
| 2167 function Process(_process) { | 2174 function Process(_process) { |
| 2168 this.SIGSYS = "SIGSYS"; | 2175 this.SIGSYS = "SIGSYS"; |
| 2169 this.SIGALRM = "SIGALRM"; | 2176 this.SIGALRM = "SIGALRM"; |
| 2170 this.SIGXCPU = "SIGXCPU"; | 2177 this.SIGXCPU = "SIGXCPU"; |
| 2171 this.SIGTSTP = "SIGTSTP"; | 2178 this.SIGTSTP = "SIGTSTP"; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 } | 2319 } |
| 2313 function get$process() { | 2320 function get$process() { |
| 2314 return new Process(get$_process()); | 2321 return new Process(get$_process()); |
| 2315 } | 2322 } |
| 2316 // ********** Library file_system ************** | 2323 // ********** Library file_system ************** |
| 2317 // ********** Code for top level ************** | 2324 // ********** Code for top level ************** |
| 2318 function joinPaths(path1, path2) { | 2325 function joinPaths(path1, path2) { |
| 2319 var pieces = path1.split("/"); | 2326 var pieces = path1.split("/"); |
| 2320 var $$list = path2.split("/"); | 2327 var $$list = path2.split("/"); |
| 2321 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2328 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2322 var piece = $$list.$index($$i); | 2329 var piece = $$list[$$i]; |
| 2323 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last$0(), ".
") && $ne(pieces.last$0(), "..")) { | 2330 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last$0(), ".
") && $ne(pieces.last$0(), "..")) { |
| 2324 pieces.removeLast$0(); | 2331 pieces.removeLast$0(); |
| 2325 } | 2332 } |
| 2326 else if ($ne(piece, "")) { | 2333 else if ($ne(piece, "")) { |
| 2327 if (pieces.get$length() > (0) && $eq(pieces.last$0(), ".")) { | 2334 if (pieces.get$length() > (0) && $eq(pieces.last$0(), ".")) { |
| 2328 pieces.removeLast$0(); | 2335 pieces.removeLast$0(); |
| 2329 } | 2336 } |
| 2330 pieces.add$1(piece); | 2337 pieces.add$1(piece); |
| 2331 } | 2338 } |
| 2332 } | 2339 } |
| 2333 return Strings.join(pieces, "/"); | 2340 return Strings.join(pieces, "/"); |
| 2334 } | 2341 } |
| 2335 function dirname(path) { | 2342 function dirname(path) { |
| 2336 var lastSlash = path.lastIndexOf("/", path.length); | 2343 var lastSlash = path.lastIndexOf("/", path.length); |
| 2337 if (lastSlash == (-1)) { | 2344 if (lastSlash == (-1)) { |
| 2338 return "."; | 2345 return "."; |
| 2339 } | 2346 } |
| 2340 else { | 2347 else { |
| 2341 return path.substring((0), lastSlash); | 2348 return path.substring((0), lastSlash); |
| 2342 } | 2349 } |
| 2343 } | 2350 } |
| 2344 function basename(path) { | 2351 function basename(path) { |
| 2345 var lastSlash = path.lastIndexOf("/", path.length); | 2352 var lastSlash = path.lastIndexOf("/", path.length); |
| 2346 if (lastSlash == (-1)) { | 2353 if (lastSlash == (-1)) { |
| 2347 return path; | 2354 return path; |
| 2348 } | 2355 } |
| 2349 else { | 2356 else { |
| 2350 return path.substring(lastSlash + (1)); | 2357 return path.substring($add(lastSlash, (1))); |
| 2351 } | 2358 } |
| 2352 } | 2359 } |
| 2353 // ********** Library file_system_node ************** | 2360 // ********** Library file_system_node ************** |
| 2354 // ********** Code for NodeFileSystem ************** | 2361 // ********** Code for NodeFileSystem ************** |
| 2355 function NodeFileSystem() { | 2362 function NodeFileSystem() { |
| 2356 | 2363 |
| 2357 } | 2364 } |
| 2358 NodeFileSystem.prototype.writeString = function(outfile, text) { | 2365 NodeFileSystem.prototype.writeString = function(outfile, text) { |
| 2359 fs.writeFileSync(outfile, text); | 2366 fs.writeFileSync(outfile, text); |
| 2360 } | 2367 } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 else { | 2693 else { |
| 2687 if (this.useWrap0) { | 2694 if (this.useWrap0) { |
| 2688 w.writeln("function $wrap_call$0(fn) { return fn; }"); | 2695 w.writeln("function $wrap_call$0(fn) { return fn; }"); |
| 2689 } | 2696 } |
| 2690 if (this.useWrap1) { | 2697 if (this.useWrap1) { |
| 2691 w.writeln("function $wrap_call$1(fn) { return fn; }"); | 2698 w.writeln("function $wrap_call$1(fn) { return fn; }"); |
| 2692 } | 2699 } |
| 2693 } | 2700 } |
| 2694 var $$list = orderValuesByKeys(this._usedOperators); | 2701 var $$list = orderValuesByKeys(this._usedOperators); |
| 2695 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2702 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2696 var opImpl = $$list.$index($$i); | 2703 var opImpl = $$list[$$i]; |
| 2697 w.writeln(opImpl); | 2704 w.writeln(opImpl); |
| 2698 } | 2705 } |
| 2699 if ($globals.world.dom != null) { | 2706 if ($globals.world.dom != null) { |
| 2700 this.ensureTypeNameOf(); | 2707 this.ensureTypeNameOf(); |
| 2701 w.writeln("Object.defineProperty(Object.prototype, \"get$typeName\", { value
: Object.prototype.$typeNameOf, enumerable: false, writable: true, configurable:
true});"); | 2708 w.writeln("Object.defineProperty(Object.prototype, \"get$typeName\", { value
: Object.prototype.$typeNameOf, enumerable: false, writable: true, configurable:
true});"); |
| 2702 } | 2709 } |
| 2703 } | 2710 } |
| 2704 CoreJs.prototype.generate$1 = CoreJs.prototype.generate; | 2711 CoreJs.prototype.generate$1 = CoreJs.prototype.generate; |
| 2705 // ********** Code for Element ************** | 2712 // ********** Code for Element ************** |
| 2706 function Element(name, _enclosingElement) { | 2713 function Element(name, _enclosingElement) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2739 Element.prototype.resolve = function() { | 2746 Element.prototype.resolve = function() { |
| 2740 | 2747 |
| 2741 } | 2748 } |
| 2742 Element.prototype.get$typeParameters = function() { | 2749 Element.prototype.get$typeParameters = function() { |
| 2743 return null; | 2750 return null; |
| 2744 } | 2751 } |
| 2745 Element.prototype.get$enclosingElement = function() { | 2752 Element.prototype.get$enclosingElement = function() { |
| 2746 return this._enclosingElement == null ? this.get$library() : this._enclosingEl
ement; | 2753 return this._enclosingElement == null ? this.get$library() : this._enclosingEl
ement; |
| 2747 } | 2754 } |
| 2748 Element.prototype.set$enclosingElement = function(e) { | 2755 Element.prototype.set$enclosingElement = function(e) { |
| 2749 return this._enclosingElement = e; | 2756 var $0; |
| 2757 return (this._enclosingElement = ($0 = e), $0); |
| 2750 } | 2758 } |
| 2751 Element.prototype.resolveType = function(node, typeErrors) { | 2759 Element.prototype.resolveType = function(node, typeErrors) { |
| 2752 if (node == null) return $globals.world.varType; | 2760 if (node == null) return $globals.world.varType; |
| 2753 if (node.type != null) return node.type; | 2761 if (node.type != null) return node.type; |
| 2754 if ((node instanceof NameTypeReference)) { | 2762 if ((node instanceof NameTypeReference)) { |
| 2755 var typeRef = node; | 2763 var typeRef = node; |
| 2756 var name; | 2764 var name; |
| 2757 if (typeRef.names != null) { | 2765 if (typeRef.names != null) { |
| 2758 name = typeRef.names.last$0().get$name(); | 2766 name = typeRef.names.last().get$name(); |
| 2759 } | 2767 } |
| 2760 else { | 2768 else { |
| 2761 name = typeRef.name.name; | 2769 name = typeRef.name.name; |
| 2762 } | 2770 } |
| 2763 if (this.get$typeParameters() != null) { | 2771 if (this.get$typeParameters() != null) { |
| 2764 var $$list = this.get$typeParameters(); | 2772 var $$list = this.get$typeParameters(); |
| 2765 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2773 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2766 var tp = $$list.$index($$i); | 2774 var tp = $$list[$$i]; |
| 2767 if ($eq(tp.get$name(), name)) { | 2775 if ($eq(tp.get$name(), name)) { |
| 2768 typeRef.type = tp; | 2776 typeRef.type = tp; |
| 2769 } | 2777 } |
| 2770 } | 2778 } |
| 2771 } | 2779 } |
| 2772 if (typeRef.type != null) { | 2780 if (typeRef.type != null) { |
| 2773 return typeRef.type; | 2781 return typeRef.type; |
| 2774 } | 2782 } |
| 2775 return this.get$enclosingElement().resolveType$2(node, typeErrors); | 2783 return this.get$enclosingElement().resolveType$2(node, typeErrors); |
| 2776 } | 2784 } |
| 2777 else if ((node instanceof GenericTypeReference)) { | 2785 else if ((node instanceof GenericTypeReference)) { |
| 2778 var typeRef = node; | 2786 var typeRef = node; |
| 2779 var baseType = this.resolveType$2(typeRef.baseType, typeErrors); | 2787 var baseType = this.resolveType$2(typeRef.baseType, typeErrors); |
| 2780 if (!baseType.get$isGeneric()) { | 2788 if (!baseType.get$isGeneric()) { |
| 2781 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR
ef.span); | 2789 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR
ef.span); |
| 2782 return null; | 2790 return null; |
| 2783 } | 2791 } |
| 2784 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$
length()) { | 2792 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$
length()) { |
| 2785 $globals.world.error("wrong number of type arguments", typeRef.span); | 2793 $globals.world.error("wrong number of type arguments", typeRef.span); |
| 2786 return null; | 2794 return null; |
| 2787 } | 2795 } |
| 2788 var typeArgs = []; | 2796 var typeArgs = []; |
| 2789 for (var i = (0); | 2797 for (var i = (0); |
| 2790 i < typeRef.typeArguments.get$length(); i++) { | 2798 i < typeRef.typeArguments.get$length(); i++) { |
| 2791 typeArgs.add$1(this.resolveType$2(typeRef.typeArguments.$index(i), typeErr
ors)); | 2799 typeArgs.add$1(this.resolveType$2(typeRef.typeArguments[i], typeErrors)); |
| 2792 } | 2800 } |
| 2793 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); | 2801 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); |
| 2794 } | 2802 } |
| 2795 else if ((node instanceof FunctionTypeReference)) { | 2803 else if ((node instanceof FunctionTypeReference)) { |
| 2796 var typeRef = node; | 2804 var typeRef = node; |
| 2797 var name = ""; | 2805 var name = ""; |
| 2798 if (typeRef.func.name != null) { | 2806 if (typeRef.func.name != null) { |
| 2799 name = typeRef.func.name.name; | 2807 name = typeRef.func.name.name; |
| 2800 } | 2808 } |
| 2801 typeRef.type = this.get$library().getOrAddFunctionType(this, name, typeRef.f
unc); | 2809 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()]); | 2833 this.markLibrariesUsed([$globals.world.coreimpl, $globals.world.corelib, thi
s.main.declaringType.get$library()]); |
| 2826 } | 2834 } |
| 2827 $globals.world.numImplType.markUsed(); | 2835 $globals.world.numImplType.markUsed(); |
| 2828 $globals.world.stringImplType.markUsed(); | 2836 $globals.world.stringImplType.markUsed(); |
| 2829 if ($globals.world.corelib.types.$index("Isolate").get$isUsed() || $globals.wo
rld.coreimpl.types.$index("ReceivePortImpl").get$isUsed()) { | 2837 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) { | 2838 if (this.corejs.useWrap0 || this.corejs.useWrap1) { |
| 2831 this.genMethod($globals.world.coreimpl.types.$index("IsolateContext").getM
ember$1("eval")); | 2839 this.genMethod($globals.world.coreimpl.types.$index("IsolateContext").getM
ember$1("eval")); |
| 2832 this.genMethod($globals.world.coreimpl.types.$index("EventLoop").getMember
$1("run")); | 2840 this.genMethod($globals.world.coreimpl.types.$index("EventLoop").getMember
$1("run")); |
| 2833 } | 2841 } |
| 2834 this.corejs.useIsolates = true; | 2842 this.corejs.useIsolates = true; |
| 2835 var isolateMain = $globals.world.coreimpl.topType.resolveMember("startRootIs
olate").members.$index((0)); | 2843 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()); | 2844 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); | 2845 mainCall = isolateMain.invoke(metaGen, null, isolateMainTarget, new Argument
s(null, [this.main._get(metaGen, this.main.definition, null, false)]), false); |
| 2838 } | 2846 } |
| 2839 this.writeTypes($globals.world.coreimpl); | 2847 this.writeTypes($globals.world.coreimpl); |
| 2840 this.writeTypes($globals.world.corelib); | 2848 this.writeTypes($globals.world.corelib); |
| 2841 this.writeTypes(this.main.declaringType.get$library()); | 2849 this.writeTypes(this.main.declaringType.get$library()); |
| 2842 if (this._mixins != null) this.writer.write(this._mixins.get$text()); | 2850 if (this._mixins != null) this.writer.write(this._mixins.get$text()); |
| 2843 this.writeDynamicDispatchMetadata(); | 2851 this.writeDynamicDispatchMetadata(); |
| 2844 this.writeGlobals(); | 2852 this.writeGlobals(); |
| 2845 this.writer.writeln(("" + mainCall.get$code() + ";")); | 2853 this.writer.writeln(("" + mainCall.get$code() + ";")); |
| 2846 } | 2854 } |
| 2847 WorldGenerator.prototype.markLibrariesUsed = function(libs) { | 2855 WorldGenerator.prototype.markLibrariesUsed = function(libs) { |
| 2848 return this.getAllTypes(libs).forEach(this.get$markTypeUsed()); | 2856 return this.getAllTypes(libs).forEach(this.get$markTypeUsed()); |
| 2849 } | 2857 } |
| 2850 WorldGenerator.prototype.markTypeUsed = function(type) { | 2858 WorldGenerator.prototype.markTypeUsed = function(type) { |
| 2851 if (!type.get$isClass()) return; | 2859 if (!type.get$isClass()) return; |
| 2852 type.markUsed(); | 2860 type.markUsed(); |
| 2853 type.isTested = true; | 2861 type.isTested = true; |
| 2854 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members
().getValues$0().every$1((function (m) { | 2862 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members
().getValues().every((function (m) { |
| 2855 return m.get$isStatic() && !m.get$isFactory(); | 2863 return m.get$isStatic() && !m.get$isFactory(); |
| 2856 }) | 2864 }) |
| 2857 )); | 2865 )); |
| 2858 var members = ListFactory.ListFactory$from$factory(type.get$members().getValue
s$0()); | 2866 var members = ListFactory.ListFactory$from$factory(type.get$members().getValue
s()); |
| 2859 members.addAll$1(type.get$constructors().getValues$0()); | 2867 members.addAll$1(type.get$constructors().getValues()); |
| 2860 type.get$factories().forEach((function (f) { | 2868 type.get$factories().forEach((function (f) { |
| 2861 return members.add$1(f); | 2869 return members.add$1(f); |
| 2862 }) | 2870 }) |
| 2863 ); | 2871 ); |
| 2864 for (var $$i = members.iterator$0(); $$i.hasNext$0(); ) { | 2872 for (var $$i = members.iterator$0(); $$i.hasNext$0(); ) { |
| 2865 var member = $$i.next$0(); | 2873 var member = $$i.next$0(); |
| 2866 if ((member instanceof PropertyMember)) { | 2874 if ((member instanceof PropertyMember)) { |
| 2867 if (member.get$getter() != null) this.genMethod(member.get$getter()); | 2875 if (member.get$getter() != null) this.genMethod(member.get$getter()); |
| 2868 if (member.get$setter() != null) this.genMethod(member.get$setter()); | 2876 if (member.get$setter() != null) this.genMethod(member.get$setter()); |
| 2869 } | 2877 } |
| 2870 if ((member instanceof MethodMember)) this.genMethod(member); | 2878 if ((member instanceof MethodMember)) this.genMethod(member); |
| 2871 } | 2879 } |
| 2872 } | 2880 } |
| 2873 WorldGenerator.prototype.get$markTypeUsed = function() { | 2881 WorldGenerator.prototype.get$markTypeUsed = function() { |
| 2874 return this.markTypeUsed.bind(this); | 2882 return this.markTypeUsed.bind(this); |
| 2875 } | 2883 } |
| 2876 WorldGenerator.prototype.getAllTypes = function(libs) { | 2884 WorldGenerator.prototype.getAllTypes = function(libs) { |
| 2877 var types = []; | 2885 var types = []; |
| 2878 var seen = new HashSetImplementation(); | 2886 var seen = new HashSetImplementation(); |
| 2879 for (var $$i = 0;$$i < libs.get$length(); $$i++) { | 2887 for (var $$i = 0;$$i < libs.get$length(); $$i++) { |
| 2880 var mainLib = libs.$index($$i); | 2888 var mainLib = libs[$$i]; |
| 2881 var toCheck = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([mainLib]); | 2889 var toCheck = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([mainLib]); |
| 2882 while (!toCheck.isEmpty()) { | 2890 while (!toCheck.isEmpty()) { |
| 2883 var lib = toCheck.removeFirst$0(); | 2891 var lib = toCheck.removeFirst(); |
| 2884 if (seen.contains(lib)) continue; | 2892 if (seen.contains(lib)) continue; |
| 2885 seen.add(lib); | 2893 seen.add(lib); |
| 2886 lib.get$imports().forEach$1((function (lib, toCheck, i) { | 2894 lib.get$imports().forEach$1((function (lib, toCheck, i) { |
| 2887 return toCheck.addLast(lib); | 2895 return toCheck.addLast(lib); |
| 2888 }).bind(null, lib, toCheck) | 2896 }).bind(null, lib, toCheck) |
| 2889 ); | 2897 ); |
| 2890 lib.get$types().getValues$0().forEach$1((function (t) { | 2898 lib.get$types().getValues$0().forEach$1((function (t) { |
| 2891 return types.add(t); | 2899 return types.add(t); |
| 2892 }) | 2900 }) |
| 2893 ); | 2901 ); |
| 2894 } | 2902 } |
| 2895 } | 2903 } |
| 2896 return types; | 2904 return types; |
| 2897 } | 2905 } |
| 2898 WorldGenerator.prototype.globalForStaticField = function(field, exp, dependencie
s) { | 2906 WorldGenerator.prototype.globalForStaticField = function(field, exp, dependencie
s) { |
| 2899 this.hasStatics = true; | 2907 this.hasStatics = true; |
| 2900 var key = ("" + field.declaringType.get$jsname() + "." + field.get$jsname()); | 2908 var key = ("" + field.declaringType.get$jsname() + "." + field.get$jsname()); |
| 2901 var ret = this.globals.$index(key); | 2909 var ret = this.globals.$index(key); |
| 2902 if (ret == null) { | 2910 if (ret == null) { |
| 2903 ret = new GlobalValue(exp.get$type(), exp.get$code(), field.isFinal, field,
null, exp, exp.span, dependencies); | 2911 ret = new GlobalValue(exp.get$type(), exp.get$code(), field.isFinal, field,
null, exp, exp.span, dependencies); |
| 2904 this.globals.$setindex(key, ret); | 2912 this.globals.$setindex(key, ret); |
| 2905 } | 2913 } |
| 2906 return ret; | 2914 return ret; |
| 2907 } | 2915 } |
| 2908 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { | 2916 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { |
| 2909 var key = exp.get$type().get$jsname() + ":" + exp.get$code(); | 2917 var key = exp.get$type().get$jsname() + ":" + exp.get$code(); |
| 2910 var ret = this.globals.$index(key); | 2918 var ret = this.globals.$index(key); |
| 2911 if (ret == null) { | 2919 if (ret == null) { |
| 2912 var ns = this.globals.get$length().toString(); | 2920 var ns = this.globals.get$length().toString$0(); |
| 2913 while (ns.get$length() < (4)) ns = "0" + ns; | 2921 while (ns.get$length() < (4)) ns = "0" + ns; |
| 2914 var name = ("const$" + ns); | 2922 var name = ("const$" + ns); |
| 2915 ret = new GlobalValue(exp.get$type(), name, true, null, name, exp, exp.span,
dependencies); | 2923 ret = new GlobalValue(exp.get$type(), name, true, null, name, exp, exp.span,
dependencies); |
| 2916 this.globals.$setindex(key, ret); | 2924 this.globals.$setindex(key, ret); |
| 2917 } | 2925 } |
| 2918 return ret; | 2926 return ret; |
| 2919 } | 2927 } |
| 2920 WorldGenerator.prototype.writeTypes = function(lib) { | 2928 WorldGenerator.prototype.writeTypes = function(lib) { |
| 2921 if (lib.isWritten) return; | 2929 if (lib.isWritten) return; |
| 2922 lib.isWritten = true; | 2930 lib.isWritten = true; |
| 2923 var $$list = lib.imports; | 2931 var $$list = lib.imports; |
| 2924 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2932 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2925 var import_ = $$list.$index($$i); | 2933 var import_ = $$list[$$i]; |
| 2926 this.writeTypes(import_.get$library()); | 2934 this.writeTypes(import_.get$library()); |
| 2927 } | 2935 } |
| 2928 for (var i = (0); | 2936 for (var i = (0); |
| 2929 i < lib.sources.get$length(); i++) { | 2937 i < lib.sources.get$length(); i++) { |
| 2930 lib.sources.$index(i).set$orderInLibrary(i); | 2938 lib.sources[i].set$orderInLibrary(i); |
| 2931 } | 2939 } |
| 2932 this.writer.comment(("// ********** Library " + lib.name + " **************")
); | 2940 this.writer.comment(("// ********** Library " + lib.name + " **************")
); |
| 2933 if (lib.get$isCore()) { | 2941 if (lib.get$isCore()) { |
| 2934 this.writer.comment("// ********** Natives dart:core **************"); | 2942 this.writer.comment("// ********** Natives dart:core **************"); |
| 2935 this.corejs.generate(this.writer); | 2943 this.corejs.generate(this.writer); |
| 2936 } | 2944 } |
| 2937 var $$list = lib.natives; | 2945 var $$list = lib.natives; |
| 2938 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2946 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2939 var file = $$list.$index($$i); | 2947 var file = $$list[$$i]; |
| 2940 var filename = basename(file.get$filename()); | 2948 var filename = basename(file.get$filename()); |
| 2941 this.writer.comment(("// ********** Natives " + filename + " **************
")); | 2949 this.writer.comment(("// ********** Natives " + filename + " **************
")); |
| 2942 this.writer.writeln(file.get$text()); | 2950 this.writer.writeln(file.get$text()); |
| 2943 } | 2951 } |
| 2944 lib.topType.markUsed(); | 2952 lib.topType.markUsed(); |
| 2945 var $$list = this._orderValues(lib.types); | 2953 var orderedTypes = this._orderValues(lib.types); |
| 2946 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2954 for (var $$i = orderedTypes.iterator$0(); $$i.hasNext$0(); ) { |
| 2947 var type = $$list.$index($$i); | 2955 var type = $$i.next$0(); |
| 2948 if ((type.get$isUsed() || type.get$library().get$isDom() || type.get$isHidde
nNativeType()) && type.get$isClass()) { | 2956 if ((type.get$library().get$isDom() || type.get$isHiddenNativeType()) && typ
e.get$isClass()) { |
| 2957 type.markUsed$0(); |
| 2958 } |
| 2959 } |
| 2960 for (var $$i = orderedTypes.iterator$0(); $$i.hasNext$0(); ) { |
| 2961 var type = $$i.next$0(); |
| 2962 if (type.get$isUsed() && type.get$isClass()) { |
| 2949 this.writeType(type); | 2963 this.writeType(type); |
| 2950 if (type.get$isGeneric()) { | 2964 if (type.get$isGeneric()) { |
| 2951 var $list0 = this._orderValues(type.get$_concreteTypes()); | 2965 var $$list = this._orderValues(type.get$_concreteTypes()); |
| 2952 for (var $i0 = 0;$i0 < $list0.get$length(); $i0++) { | 2966 for (var $i0 = 0;$i0 < $$list.get$length(); $i0++) { |
| 2953 var ct = $list0.$index($i0); | 2967 var ct = $$list[$i0]; |
| 2954 this.writeType(ct); | 2968 this.writeType(ct); |
| 2955 } | 2969 } |
| 2956 } | 2970 } |
| 2957 } | 2971 } |
| 2958 else if (type.get$isFunction() && type.get$varStubs().get$length() > (0)) { | 2972 else if (type.get$isFunction() && type.get$varStubs().get$length() > (0)) { |
| 2959 this.writer.comment(("// ********** Code for " + type.get$jsname() + " ***
***********")); | 2973 this.writer.comment(("// ********** Code for " + type.get$jsname() + " ***
***********")); |
| 2960 this._writeDynamicStubs(type); | 2974 this._writeDynamicStubs(type); |
| 2961 } | 2975 } |
| 2962 if (type.get$typeCheckCode() != null) { | 2976 if (type.get$typeCheckCode() != null) { |
| 2963 this.writer.writeln(type.get$typeCheckCode()); | 2977 this.writer.writeln(type.get$typeCheckCode()); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3078 else { | 3092 else { |
| 3079 var standardConstructor = type.get$constructors().$index(""); | 3093 var standardConstructor = type.get$constructors().$index(""); |
| 3080 if (standardConstructor == null || standardConstructor.generator == null) { | 3094 if (standardConstructor == null || standardConstructor.generator == null) { |
| 3081 if (!type.get$isNative()) { | 3095 if (!type.get$isNative()) { |
| 3082 this.writer.writeln(("function " + type.get$jsname() + "() {}")); | 3096 this.writer.writeln(("function " + type.get$jsname() + "() {}")); |
| 3083 } | 3097 } |
| 3084 } | 3098 } |
| 3085 else { | 3099 else { |
| 3086 standardConstructor.generator.writeDefinition(this.writer, null); | 3100 standardConstructor.generator.writeDefinition(this.writer, null); |
| 3087 } | 3101 } |
| 3088 var $$list = type.get$constructors().getValues$0(); | 3102 var $$list = type.get$constructors().getValues(); |
| 3089 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3103 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3090 var c = $$i.next$0(); | 3104 var c = $$i.next$0(); |
| 3091 if (c.get$generator() != null && $ne(c, standardConstructor)) { | 3105 if (c.get$generator() != null && $ne(c, standardConstructor)) { |
| 3092 c.get$generator().writeDefinition$2(this.writer); | 3106 c.get$generator().writeDefinition$2(this.writer); |
| 3093 } | 3107 } |
| 3094 } | 3108 } |
| 3095 } | 3109 } |
| 3096 if (!(type instanceof ConcreteType)) { | 3110 if (!(type instanceof ConcreteType)) { |
| 3097 this._maybeIsTest(type, type); | 3111 this._maybeIsTest(type, type); |
| 3098 } | 3112 } |
| 3099 if (type.get$genericType()._concreteTypes != null) { | 3113 if (type.get$genericType()._concreteTypes != null) { |
| 3100 var $$list = this._orderValues(type.get$genericType()._concreteTypes); | 3114 var $$list = this._orderValues(type.get$genericType()._concreteTypes); |
| 3101 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3115 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3102 var ct = $$list.$index($$i); | 3116 var ct = $$list[$$i]; |
| 3103 this._maybeIsTest(type, ct); | 3117 this._maybeIsTest(type, ct); |
| 3104 } | 3118 } |
| 3105 } | 3119 } |
| 3106 if (type.get$interfaces() != null) { | 3120 if (type.get$interfaces() != null) { |
| 3107 var seen = new HashSetImplementation(); | 3121 var seen = new HashSetImplementation(); |
| 3108 var worklist = []; | 3122 var worklist = []; |
| 3109 worklist.addAll$1(type.get$interfaces()); | 3123 worklist.addAll$1(type.get$interfaces()); |
| 3110 seen.addAll$1(type.get$interfaces()); | 3124 seen.addAll$1(type.get$interfaces()); |
| 3111 while (!worklist.isEmpty$0()) { | 3125 while (!worklist.isEmpty$0()) { |
| 3112 var interface_ = worklist.removeLast$0(); | 3126 var interface_ = worklist.removeLast$0(); |
| 3113 this._maybeIsTest(type, interface_.get$genericType()); | 3127 this._maybeIsTest(type, interface_.get$genericType()); |
| 3114 if (interface_.get$genericType().get$_concreteTypes() != null) { | 3128 if (interface_.get$genericType().get$_concreteTypes() != null) { |
| 3115 var $$list = this._orderValues(interface_.get$genericType().get$_concret
eTypes()); | 3129 var $$list = this._orderValues(interface_.get$genericType().get$_concret
eTypes()); |
| 3116 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3130 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3117 var ct = $$list.$index($$i); | 3131 var ct = $$list[$$i]; |
| 3118 this._maybeIsTest(type, ct); | 3132 this._maybeIsTest(type, ct); |
| 3119 } | 3133 } |
| 3120 } | 3134 } |
| 3121 var $$list = interface_.get$interfaces(); | 3135 var $$list = interface_.get$interfaces(); |
| 3122 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3136 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3123 var other = $$i.next$0(); | 3137 var other = $$i.next$0(); |
| 3124 if (!seen.contains$1(other)) { | 3138 if (!seen.contains$1(other)) { |
| 3125 worklist.addLast$1(other); | 3139 worklist.addLast$1(other); |
| 3126 seen.add$1(other); | 3140 seen.add$1(other); |
| 3127 } | 3141 } |
| 3128 } | 3142 } |
| 3129 } | 3143 } |
| 3130 } | 3144 } |
| 3131 type.get$factories().forEach(this.get$_writeMethod()); | 3145 type.get$factories().forEach(this.get$_writeMethod()); |
| 3132 var $$list = this._orderValues(type.get$members()); | 3146 var $$list = this._orderValues(type.get$members()); |
| 3133 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3147 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3134 var member = $$list.$index($$i); | 3148 var member = $$list[$$i]; |
| 3135 if ((member instanceof FieldMember)) { | 3149 if ((member instanceof FieldMember)) { |
| 3136 this._writeField(member); | 3150 this._writeField(member); |
| 3137 } | 3151 } |
| 3138 if ((member instanceof PropertyMember)) { | 3152 if ((member instanceof PropertyMember)) { |
| 3139 this._writeProperty(member); | 3153 this._writeProperty(member); |
| 3140 } | 3154 } |
| 3141 if (member.get$isMethod()) { | 3155 if (member.get$isMethod()) { |
| 3142 this._writeMethod(member); | 3156 this._writeMethod(member); |
| 3143 } | 3157 } |
| 3144 } | 3158 } |
| 3145 this._writeDynamicStubs(type); | 3159 this._writeDynamicStubs(type); |
| 3146 } | 3160 } |
| 3147 WorldGenerator.prototype._typeNeedsHolderForStaticMethods = function(type) { | 3161 WorldGenerator.prototype._typeNeedsHolderForStaticMethods = function(type) { |
| 3148 var $$list = type.get$members().getValues$0(); | 3162 var $$list = type.get$members().getValues(); |
| 3149 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3163 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3150 var member = $$i.next$0(); | 3164 var member = $$i.next$0(); |
| 3151 if (member.get$isMethod()) { | 3165 if (member.get$isMethod()) { |
| 3152 if (member.get$isConstructor() || member.get$isStatic()) { | 3166 if (member.get$isConstructor() || member.get$isStatic()) { |
| 3153 if (member.get$isGenerated()) { | 3167 if (member.get$isGenerated()) { |
| 3154 return true; | 3168 return true; |
| 3155 } | 3169 } |
| 3156 } | 3170 } |
| 3157 } | 3171 } |
| 3158 } | 3172 } |
| 3159 return false; | 3173 return false; |
| 3160 } | 3174 } |
| 3161 WorldGenerator.prototype._ensureInheritMembersHelper = function() { | 3175 WorldGenerator.prototype._ensureInheritMembersHelper = function() { |
| 3162 if (this._mixins != null) return; | 3176 if (this._mixins != null) return; |
| 3163 this._mixins = new CodeWriter(); | 3177 this._mixins = new CodeWriter(); |
| 3164 this._mixins.comment("// ********** Generic Type Inheritance **************"); | 3178 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}"); | 3179 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 } | 3180 } |
| 3167 WorldGenerator.prototype._writeDynamicStubs = function(type) { | 3181 WorldGenerator.prototype._writeDynamicStubs = function(type) { |
| 3168 var $$list = orderValuesByKeys(type.varStubs); | 3182 var $$list = orderValuesByKeys(type.varStubs); |
| 3169 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3183 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3170 var stub = $$list.$index($$i); | 3184 var stub = $$list[$$i]; |
| 3171 if (!stub.get$isGenerated()) stub.generate$1(this.writer); | 3185 if (!stub.get$isGenerated()) stub.generate$1(this.writer); |
| 3172 } | 3186 } |
| 3173 } | 3187 } |
| 3174 WorldGenerator.prototype._writeStaticField = function(field) { | 3188 WorldGenerator.prototype._writeStaticField = function(field) { |
| 3175 if (field.isFinal) return; | 3189 if (field.isFinal) return; |
| 3176 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); | 3190 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); |
| 3177 if (this.globals.containsKey(fullname)) { | 3191 if (this.globals.containsKey(fullname)) { |
| 3178 var value = this.globals.$index(fullname); | 3192 var value = this.globals.$index(fullname); |
| 3179 if (field.declaringType.get$isTop() && !field.isNative) { | 3193 if (field.declaringType.get$isTop() && !field.isNative) { |
| 3180 this.writer.writeln(("$globals." + field.get$jsname() + " = " + value.get$
exp().get$code() + ";")); | 3194 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) { | 3231 else if ((m instanceof MethodMember) && m.get$isNative() && m._provideProperty
Syntax && !m._provideFieldSyntax) { |
| 3218 MethodGenerator._maybeGenerateBoundGetter(m, this.writer); | 3232 MethodGenerator._maybeGenerateBoundGetter(m, this.writer); |
| 3219 } | 3233 } |
| 3220 } | 3234 } |
| 3221 WorldGenerator.prototype.get$_writeMethod = function() { | 3235 WorldGenerator.prototype.get$_writeMethod = function() { |
| 3222 return this._writeMethod.bind(this); | 3236 return this._writeMethod.bind(this); |
| 3223 } | 3237 } |
| 3224 WorldGenerator.prototype.writeGlobals = function() { | 3238 WorldGenerator.prototype.writeGlobals = function() { |
| 3225 if (this.globals.get$length() > (0)) { | 3239 if (this.globals.get$length() > (0)) { |
| 3226 this.writer.comment("// ********** Globals **************"); | 3240 this.writer.comment("// ********** Globals **************"); |
| 3227 var list = this.globals.getValues$0(); | 3241 var list = this.globals.getValues(); |
| 3228 list.sort$1((function (a, b) { | 3242 list.sort$1((function (a, b) { |
| 3229 return a.compareTo$1(b); | 3243 return a.compareTo$1(b); |
| 3230 }) | 3244 }) |
| 3231 ); | 3245 ); |
| 3232 this.writer.enterBlock("function $static_init(){"); | 3246 this.writer.enterBlock("function $static_init(){"); |
| 3233 for (var $$i = list.iterator$0(); $$i.hasNext$0(); ) { | 3247 for (var $$i = list.iterator$0(); $$i.hasNext$0(); ) { |
| 3234 var global = $$i.next$0(); | 3248 var global = $$i.next$0(); |
| 3235 if (global.get$field() != null) { | 3249 if (global.get$field() != null) { |
| 3236 this._writeStaticField(global.get$field()); | 3250 this._writeStaticField(global.get$field()); |
| 3237 } | 3251 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 3261 var $this = this; // closure support | 3275 var $this = this; // closure support |
| 3262 if (this.typesWithDynamicDispatch == null) return; | 3276 if (this.typesWithDynamicDispatch == null) return; |
| 3263 this.writer.comment(("// " + this.typesWithDynamicDispatch.get$length() + " dy
namic types.")); | 3277 this.writer.comment(("// " + this.typesWithDynamicDispatch.get$length() + " dy
namic types.")); |
| 3264 var seen = new HashSetImplementation(); | 3278 var seen = new HashSetImplementation(); |
| 3265 var types = []; | 3279 var types = []; |
| 3266 function visit(type) { | 3280 function visit(type) { |
| 3267 if (seen.contains$1(type)) return; | 3281 if (seen.contains$1(type)) return; |
| 3268 seen.add$1(type); | 3282 seen.add$1(type); |
| 3269 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); | 3283 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); |
| 3270 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3284 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3271 var subtype = $$list.$index($$i); | 3285 var subtype = $$list[$$i]; |
| 3272 visit(subtype); | 3286 visit.call$1(subtype); |
| 3273 } | 3287 } |
| 3274 types.add$1(type); | 3288 types.add$1(type); |
| 3275 } | 3289 } |
| 3276 var $$list = this._orderCollectionValues(this.typesWithDynamicDispatch); | 3290 var $$list = this._orderCollectionValues(this.typesWithDynamicDispatch); |
| 3277 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3291 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3278 var type = $$list.$index($$i); | 3292 var type = $$list[$$i]; |
| 3279 visit(type); | 3293 visit.call$1(type); |
| 3280 } | 3294 } |
| 3281 var dispatchTypes = types.filter$1((function (type) { | 3295 var dispatchTypes = types.filter$1((function (type) { |
| 3282 return !type.get$directSubtypes().isEmpty$0() && $this.typesWithDynamicDispa
tch.contains(type); | 3296 return !type.get$directSubtypes().isEmpty$0() && $this.typesWithDynamicDispa
tch.contains(type); |
| 3283 }) | 3297 }) |
| 3284 ); | 3298 ); |
| 3285 this.writer.comment(("// " + types.get$length() + " types")); | 3299 this.writer.comment(("// " + types.get$length() + " types")); |
| 3286 this.writer.comment(("// " + types.filter$1((function (t) { | 3300 this.writer.comment(("// " + types.filter$1((function (t) { |
| 3287 return !t.get$directSubtypes().isEmpty$0(); | 3301 return !t.get$directSubtypes().isEmpty$0(); |
| 3288 }) | 3302 }) |
| 3289 ).get$length() + " !leaf")); | 3303 ).get$length() + " !leaf")); |
| 3290 var varNames = []; | 3304 var varNames = []; |
| 3291 var varDefns = new HashMapImplementation(); | 3305 var varDefns = new HashMapImplementation(); |
| 3292 var tagDefns = new HashMapImplementation(); | 3306 var tagDefns = new HashMapImplementation(); |
| 3293 function makeExpression(type) { | 3307 function makeExpression(type) { |
| 3294 var expressions = []; | 3308 var expressions = []; |
| 3295 var subtags = [type.get$nativeName()]; | 3309 var subtags = [type.get$nativeName()]; |
| 3296 function walk(type) { | 3310 function walk(type) { |
| 3297 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); | 3311 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); |
| 3298 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3312 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3299 var subtype = $$list.$index($$i); | 3313 var subtype = $$list[$$i]; |
| 3300 var tag = subtype.get$nativeName(); | 3314 var tag = subtype.get$nativeName(); |
| 3301 var existing = tagDefns.$index(tag); | 3315 var existing = tagDefns.$index(tag); |
| 3302 if (existing == null) { | 3316 if (existing == null) { |
| 3303 subtags.add$1(tag); | 3317 subtags.add$1(tag); |
| 3304 walk(subtype); | 3318 walk.call$1(subtype); |
| 3305 } | 3319 } |
| 3306 else { | 3320 else { |
| 3307 if (varDefns.containsKey$1(existing)) { | 3321 if (varDefns.containsKey$1(existing)) { |
| 3308 expressions.add$1(existing); | 3322 expressions.add$1(existing); |
| 3309 } | 3323 } |
| 3310 else { | 3324 else { |
| 3311 var varName = ("v" + varNames.get$length() + "/*" + tag + "*/"); | 3325 var varName = ("v" + varNames.get$length() + "/*" + tag + "*/"); |
| 3312 varNames.add$1(varName); | 3326 varNames.add$1(varName); |
| 3313 varDefns.$setindex(varName, existing); | 3327 varDefns.$setindex(varName, existing); |
| 3314 tagDefns.$setindex(tag, varName); | 3328 tagDefns.$setindex(tag, varName); |
| 3315 expressions.add$1(varName); | 3329 expressions.add$1(varName); |
| 3316 } | 3330 } |
| 3317 } | 3331 } |
| 3318 } | 3332 } |
| 3319 } | 3333 } |
| 3320 walk(type); | 3334 walk.call$1(type); |
| 3321 var constantPart = ("'" + Strings.join(subtags, "|") + "'"); | 3335 var constantPart = ("'" + Strings.join(subtags, "|") + "'"); |
| 3322 if ($ne(constantPart, "''")) expressions.add$1(constantPart); | 3336 if ($ne(constantPart, "''")) expressions.add$1(constantPart); |
| 3323 var expression; | 3337 var expression; |
| 3324 if ($eq(expressions.get$length(), (1))) { | 3338 if ($eq(expressions.get$length(), (1))) { |
| 3325 expression = expressions.$index((0)); | 3339 expression = expressions.$index((0)); |
| 3326 } | 3340 } |
| 3327 else { | 3341 else { |
| 3328 expression = ("[" + Strings.join(expressions, ",") + "].join('|')"); | 3342 expression = ("[" + Strings.join(expressions, ",") + "].join('|')"); |
| 3329 } | 3343 } |
| 3330 return expression; | 3344 return expression; |
| 3331 } | 3345 } |
| 3332 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { | 3346 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { |
| 3333 var type = $$i.next$0(); | 3347 var type = $$i.next$0(); |
| 3334 tagDefns.$setindex(type.get$nativeName(), makeExpression(type)); | 3348 tagDefns.$setindex(type.get$nativeName(), makeExpression.call$1(type)); |
| 3335 } | 3349 } |
| 3336 if (!tagDefns.isEmpty$0()) { | 3350 if (!tagDefns.isEmpty$0()) { |
| 3337 this.writer.enterBlock("(function(){"); | 3351 this.writer.enterBlock("(function(){"); |
| 3338 for (var $$i = varNames.iterator$0(); $$i.hasNext$0(); ) { | 3352 for (var $$i = varNames.iterator$0(); $$i.hasNext$0(); ) { |
| 3339 var varName = $$i.next$0(); | 3353 var varName = $$i.next$0(); |
| 3340 this.writer.writeln(("var " + varName + " = " + varDefns.$index(varName) +
";")); | 3354 this.writer.writeln(("var " + varName + " = " + varDefns.$index(varName) +
";")); |
| 3341 } | 3355 } |
| 3342 this.writer.enterBlock("var table = ["); | 3356 this.writer.enterBlock("var table = ["); |
| 3343 this.writer.comment("// [dynamic-dispatch-tag, tags of classes implementing
dynamic-dispatch-tag]"); | 3357 this.writer.comment("// [dynamic-dispatch-tag, tags of classes implementing
dynamic-dispatch-tag]"); |
| 3344 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { | 3358 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3409 } | 3423 } |
| 3410 MethodGenerator.prototype.get$isStatic = function() { | 3424 MethodGenerator.prototype.get$isStatic = function() { |
| 3411 return this.method.get$isStatic(); | 3425 return this.method.get$isStatic(); |
| 3412 } | 3426 } |
| 3413 MethodGenerator.prototype.getTemp = function(value) { | 3427 MethodGenerator.prototype.getTemp = function(value) { |
| 3414 return value.get$needsTemp() ? this.forceTemp(value) : value; | 3428 return value.get$needsTemp() ? this.forceTemp(value) : value; |
| 3415 } | 3429 } |
| 3416 MethodGenerator.prototype.forceTemp = function(value) { | 3430 MethodGenerator.prototype.forceTemp = function(value) { |
| 3417 var name; | 3431 var name; |
| 3418 if (this._freeTemps.get$length() > (0)) { | 3432 if (this._freeTemps.get$length() > (0)) { |
| 3419 name = this._freeTemps.removeLast$0(); | 3433 name = this._freeTemps.removeLast(); |
| 3420 } | 3434 } |
| 3421 else { | 3435 else { |
| 3422 name = "$" + this._usedTemps.get$length(); | 3436 name = "$" + this._usedTemps.get$length(); |
| 3423 } | 3437 } |
| 3424 this._usedTemps.add(name); | 3438 this._usedTemps.add(name); |
| 3425 return new VariableValue(value.get$staticType(), name, value.span, false, valu
e); | 3439 return new VariableValue(value.get$staticType(), name, value.span, false, valu
e); |
| 3426 } | 3440 } |
| 3427 MethodGenerator.prototype.assignTemp = function(tmp, v) { | 3441 MethodGenerator.prototype.assignTemp = function(tmp, v) { |
| 3428 if ($eq(tmp, v)) { | 3442 if ($eq(tmp, v)) { |
| 3429 return v; | 3443 return v; |
| 3430 } | 3444 } |
| 3431 else { | 3445 else { |
| 3432 return new Value(v.get$type(), ("(" + tmp.get$code() + " = " + v.get$code()
+ ")"), v.span); | 3446 return new Value(v.get$type(), ("(" + tmp.get$code() + " = " + v.get$code()
+ ")"), v.span); |
| 3433 } | 3447 } |
| 3434 } | 3448 } |
| 3435 MethodGenerator.prototype.freeTemp = function(value) { | 3449 MethodGenerator.prototype.freeTemp = function(value) { |
| 3436 if (this._usedTemps.remove(value.code)) { | 3450 |
| 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 } | 3451 } |
| 3443 MethodGenerator.prototype.run = function() { | 3452 MethodGenerator.prototype.run = function() { |
| 3444 if (this.method.isGenerated) return; | 3453 if (this.method.isGenerated) return; |
| 3445 this.method.isGenerated = true; | 3454 this.method.isGenerated = true; |
| 3446 this.method.generator = this; | 3455 this.method.generator = this; |
| 3447 var thisObject; | 3456 var thisObject; |
| 3448 if (this.method.get$isConstructor()) { | 3457 if (this.method.get$isConstructor()) { |
| 3449 thisObject = new ObjectValue(false, this.method.declaringType, this.method.g
et$span()); | 3458 thisObject = new ObjectValue(false, this.method.declaringType, this.method.g
et$span()); |
| 3450 thisObject.initFields$0(); | 3459 thisObject.initFields$0(); |
| 3451 } | 3460 } |
| 3452 else { | 3461 else { |
| 3453 thisObject = new Value(this.method.declaringType, "this", null); | 3462 thisObject = new Value(this.method.declaringType, "this", null); |
| 3454 } | 3463 } |
| 3455 var values = []; | 3464 var values = []; |
| 3456 var $$list = this.method.get$parameters(); | 3465 var $$list = this.method.get$parameters(); |
| 3457 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3466 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3458 var p = $$list.$index($$i); | 3467 var p = $$list[$$i]; |
| 3459 values.add$1(new Value(p.get$type(), p.get$name(), null)); | 3468 values.add$1(new Value(p.get$type(), p.get$name(), null)); |
| 3460 } | 3469 } |
| 3461 var args = new Arguments(null, values); | 3470 var args = new Arguments(null, values); |
| 3462 this.evalBody(thisObject, args); | 3471 this.evalBody(thisObject, args); |
| 3463 if (this.method.get$definition().get$nativeBody() != null) { | 3472 if (this.method.get$definition().get$nativeBody() != null) { |
| 3464 this.writer = new CodeWriter(); | 3473 this.writer = new CodeWriter(); |
| 3465 if ($eq(this.method.get$definition().get$nativeBody(), "")) { | 3474 if ($eq(this.method.get$definition().get$nativeBody(), "")) { |
| 3466 this.method.generator = null; | 3475 this.method.generator = null; |
| 3467 } | 3476 } |
| 3468 else { | 3477 else { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3566 } | 3575 } |
| 3567 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { | 3576 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { |
| 3568 if ((this.method instanceof MethodMember)) { | 3577 if ((this.method instanceof MethodMember)) { |
| 3569 var meth = this.method; | 3578 var meth = this.method; |
| 3570 if (meth._provideOptionalParamInfo) { | 3579 if (meth._provideOptionalParamInfo) { |
| 3571 var optNames = []; | 3580 var optNames = []; |
| 3572 var optValues = []; | 3581 var optValues = []; |
| 3573 meth.genParameterValues(); | 3582 meth.genParameterValues(); |
| 3574 var $$list = meth.parameters; | 3583 var $$list = meth.parameters; |
| 3575 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3584 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3576 var param = $$list.$index($$i); | 3585 var param = $$list[$$i]; |
| 3577 if (param.get$isOptional()) { | 3586 if (param.get$isOptional()) { |
| 3578 optNames.add$1(param.get$name()); | 3587 optNames.add$1(param.get$name()); |
| 3579 optValues.add$1(MethodGenerator._escapeString(param.get$value().get$co
de())); | 3588 optValues.add$1(MethodGenerator._escapeString(param.get$value().get$co
de())); |
| 3580 } | 3589 } |
| 3581 } | 3590 } |
| 3582 if (optNames.get$length() > (0)) { | 3591 if (optNames.get$length() > (0)) { |
| 3583 var start = ""; | 3592 var start = ""; |
| 3584 if (meth.isStatic) { | 3593 if (meth.isStatic) { |
| 3585 if (!meth.declaringType.get$isTop()) { | 3594 if (!meth.declaringType.get$isTop()) { |
| 3586 start = meth.declaringType.get$jsname() + "."; | 3595 start = meth.declaringType.get$jsname() + "."; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3607 return newObject.setField(field, value, true); | 3616 return newObject.setField(field, value, true); |
| 3608 } | 3617 } |
| 3609 MethodGenerator.prototype.evalBody = function(newObject, args) { | 3618 MethodGenerator.prototype.evalBody = function(newObject, args) { |
| 3610 var fieldsSet = false; | 3619 var fieldsSet = false; |
| 3611 if (this.method.get$isNative() && this.method.get$isConstructor() && (newObjec
t instanceof ObjectValue)) { | 3620 if (this.method.get$isNative() && this.method.get$isConstructor() && (newObjec
t instanceof ObjectValue)) { |
| 3612 newObject.get$dynamic().set$seenNativeInitializer(true); | 3621 newObject.get$dynamic().set$seenNativeInitializer(true); |
| 3613 } | 3622 } |
| 3614 this._paramCode = []; | 3623 this._paramCode = []; |
| 3615 for (var i = (0); | 3624 for (var i = (0); |
| 3616 i < this.method.get$parameters().get$length(); i++) { | 3625 i < this.method.get$parameters().get$length(); i++) { |
| 3617 var p = this.method.get$parameters().$index(i); | 3626 var p = this.method.get$parameters()[i]; |
| 3618 var currentArg = null; | 3627 var currentArg = null; |
| 3619 if (i < args.get$bareCount()) { | 3628 if (i < args.get$bareCount()) { |
| 3620 currentArg = args.values.$index(i); | 3629 currentArg = args.values[i]; |
| 3621 } | 3630 } |
| 3622 else { | 3631 else { |
| 3623 currentArg = args.getValue(p.get$name()); | 3632 currentArg = args.getValue(p.get$name()); |
| 3624 if (currentArg == null) { | 3633 if (currentArg == null) { |
| 3625 p.genValue$2(this.method, this.method.generator); | 3634 p.genValue$2(this.method, this.method.generator); |
| 3626 currentArg = p.get$value(); | 3635 currentArg = p.get$value(); |
| 3627 } | 3636 } |
| 3628 } | 3637 } |
| 3629 if (p.get$isInitializer()) { | 3638 if (p.get$isInitializer()) { |
| 3630 this._paramCode.add(p.get$name()); | 3639 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); | 3762 var value = m.invoke$4(this, node, target, newArgs); |
| 3754 if ($ne(target.get$type(), $globals.world.objectType)) { | 3763 if ($ne(target.get$type(), $globals.world.objectType)) { |
| 3755 this.writer.writeln(("" + value.get$code() + ";")); | 3764 this.writer.writeln(("" + value.get$code() + ";")); |
| 3756 } | 3765 } |
| 3757 } | 3766 } |
| 3758 } | 3767 } |
| 3759 MethodGenerator.prototype._makeArgs = function(arguments) { | 3768 MethodGenerator.prototype._makeArgs = function(arguments) { |
| 3760 var args = []; | 3769 var args = []; |
| 3761 var seenLabel = false; | 3770 var seenLabel = false; |
| 3762 for (var $$i = 0;$$i < arguments.get$length(); $$i++) { | 3771 for (var $$i = 0;$$i < arguments.get$length(); $$i++) { |
| 3763 var arg = arguments.$index($$i); | 3772 var arg = arguments[$$i]; |
| 3764 if (arg.get$label() != null) { | 3773 if (arg.get$label() != null) { |
| 3765 seenLabel = true; | 3774 seenLabel = true; |
| 3766 } | 3775 } |
| 3767 else if (seenLabel) { | 3776 else if (seenLabel) { |
| 3768 $globals.world.error("bare argument can not follow named arguments", arg.g
et$span()); | 3777 $globals.world.error("bare argument can not follow named arguments", arg.g
et$span()); |
| 3769 } | 3778 } |
| 3770 args.add$1(this.visitValue(arg.get$value())); | 3779 args.add$1(this.visitValue(arg.get$value())); |
| 3771 } | 3780 } |
| 3772 return new Arguments(arguments, args); | 3781 return new Arguments(arguments, args); |
| 3773 } | 3782 } |
| 3774 MethodGenerator.prototype._invokeNative = function(name, arguments) { | 3783 MethodGenerator.prototype._invokeNative = function(name, arguments) { |
| 3775 var args = Arguments.get$EMPTY(); | 3784 var args = Arguments.get$EMPTY(); |
| 3776 if (arguments.get$length() > (0)) { | 3785 if (arguments.get$length() > (0)) { |
| 3777 args = new Arguments(null, arguments); | 3786 args = new Arguments(null, arguments); |
| 3778 } | 3787 } |
| 3779 var method = $globals.world.corelib.topType.members.$index(name); | 3788 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); | 3789 return method.invoke$4(this, method.get$definition(), new Value($globals.world
.corelib.topType, null, null), args); |
| 3781 } | 3790 } |
| 3782 MethodGenerator._escapeString = function(text) { | 3791 MethodGenerator._escapeString = function(text) { |
| 3783 return text.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n",
"\\n").replaceAll("\r", "\\r"); | 3792 return text.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n",
"\\n").replaceAll("\r", "\\r"); |
| 3784 } | 3793 } |
| 3785 MethodGenerator.prototype.visitStatementsInBlock = function(body) { | 3794 MethodGenerator.prototype.visitStatementsInBlock = function(body) { |
| 3786 if ((body instanceof BlockStatement)) { | 3795 if ((body instanceof BlockStatement)) { |
| 3787 var block = body; | 3796 var block = body; |
| 3788 var $$list = block.body; | 3797 var $$list = block.body; |
| 3789 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3798 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3790 var stmt = $$list.$index($$i); | 3799 var stmt = $$list[$$i]; |
| 3791 stmt.visit$1(this); | 3800 stmt.visit$1(this); |
| 3792 } | 3801 } |
| 3793 } | 3802 } |
| 3794 else { | 3803 else { |
| 3795 if (body != null) body.visit(this); | 3804 if (body != null) body.visit(this); |
| 3796 } | 3805 } |
| 3797 return false; | 3806 return false; |
| 3798 } | 3807 } |
| 3799 MethodGenerator.prototype._pushBlock = function(node, reentrant) { | 3808 MethodGenerator.prototype._pushBlock = function(node, reentrant) { |
| 3800 this._scope = new BlockScope(this, this._scope, node, reentrant); | 3809 this._scope = new BlockScope(this, this._scope, node, reentrant); |
| 3801 } | 3810 } |
| 3802 MethodGenerator.prototype._popBlock = function(node) { | 3811 MethodGenerator.prototype._popBlock = function(node) { |
| 3803 if (this._scope.node != node) { | 3812 if (this._scope.node != node) { |
| 3804 function spanOf(n) { | 3813 function spanOf(n) { |
| 3805 return n != null ? n.get$span() : null; | 3814 return n != null ? n.get$span() : null; |
| 3806 } | 3815 } |
| 3807 $globals.world.internalError(("scope mismatch. Trying to pop \"" + node + "\
" but found ") + (" \"" + this._scope.node + "\""), spanOf(node), spanOf(this._s
cope.node)); | 3816 $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 } | 3817 } |
| 3809 this._scope = this._scope.parent; | 3818 this._scope = this._scope.parent; |
| 3810 } | 3819 } |
| 3811 MethodGenerator.prototype._visitLoop = function(node, visitBody) { | 3820 MethodGenerator.prototype._visitLoop = function(node, visitBody) { |
| 3812 if (this._scope.inferTypes) { | 3821 if (this._scope.inferTypes) { |
| 3813 this._loopFixedPoint(node, visitBody); | 3822 this._loopFixedPoint(node, visitBody); |
| 3814 } | 3823 } |
| 3815 else { | 3824 else { |
| 3816 this._pushBlock(node, true); | 3825 this._pushBlock(node, true); |
| 3817 visitBody(); | 3826 visitBody.call$0(); |
| 3818 this._popBlock(node); | 3827 this._popBlock(node); |
| 3819 } | 3828 } |
| 3820 } | 3829 } |
| 3821 MethodGenerator.prototype._loopFixedPoint = function(node, visitBody) { | 3830 MethodGenerator.prototype._loopFixedPoint = function(node, visitBody) { |
| 3822 var savedCounters = this.counters; | 3831 var savedCounters = this.counters; |
| 3823 var savedWriter = this.writer; | 3832 var savedWriter = this.writer; |
| 3824 var tries = (0); | 3833 var tries = (0); |
| 3825 var startScope = this._scope.snapshot(); | 3834 var startScope = this._scope.snapshot(); |
| 3826 var s = startScope; | 3835 var s = startScope; |
| 3827 while (true) { | 3836 while (true) { |
| 3828 this.writer = new CodeWriter(); | 3837 this.writer = new CodeWriter(); |
| 3829 this.counters = new CounterLog(); | 3838 this.counters = new CounterLog(); |
| 3830 this._pushBlock(node, true); | 3839 this._pushBlock(node, true); |
| 3831 if (tries++ >= $globals.options.maxInferenceIterations) { | 3840 if (tries++ >= $globals.options.maxInferenceIterations) { |
| 3832 this._scope.inferTypes = false; | 3841 this._scope.inferTypes = false; |
| 3833 } | 3842 } |
| 3834 visitBody(); | 3843 visitBody.call$0(); |
| 3835 this._popBlock(node); | 3844 this._popBlock(node); |
| 3836 if (!this._scope.inferTypes || !this._scope.unionWith(s)) { | 3845 if (!this._scope.inferTypes || !this._scope.unionWith(s)) { |
| 3837 break; | 3846 break; |
| 3838 } | 3847 } |
| 3839 s = this._scope.snapshot(); | 3848 s = this._scope.snapshot(); |
| 3840 } | 3849 } |
| 3841 savedWriter.write$1(this.writer.get$text()); | 3850 savedWriter.write$1(this.writer.get$text()); |
| 3842 this.writer = savedWriter; | 3851 this.writer = savedWriter; |
| 3843 savedCounters.add$1(this.counters); | 3852 savedCounters.add$1(this.counters); |
| 3844 this.counters = savedCounters; | 3853 this.counters = savedCounters; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3876 } | 3885 } |
| 3877 return this.visitValue(node); | 3886 return this.visitValue(node); |
| 3878 } | 3887 } |
| 3879 MethodGenerator.prototype.visitDietStatement = function(node) { | 3888 MethodGenerator.prototype.visitDietStatement = function(node) { |
| 3880 var parser = new Parser(node.span.file, false, false, false, node.span.start); | 3889 var parser = new Parser(node.span.file, false, false, false, node.span.start); |
| 3881 this.visitStatementsInBlock(parser.block$0()); | 3890 this.visitStatementsInBlock(parser.block$0()); |
| 3882 return false; | 3891 return false; |
| 3883 } | 3892 } |
| 3884 MethodGenerator.prototype.visitVariableDefinition = function(node) { | 3893 MethodGenerator.prototype.visitVariableDefinition = function(node) { |
| 3885 var isFinal = false; | 3894 var isFinal = false; |
| 3886 if (node.modifiers != null && $eq(node.modifiers.$index((0)).get$kind(), (99))
) { | 3895 if (node.modifiers != null && $eq(node.modifiers[(0)].get$kind(), (99))) { |
| 3887 isFinal = true; | 3896 isFinal = true; |
| 3888 } | 3897 } |
| 3889 this.writer.write("var "); | 3898 this.writer.write("var "); |
| 3890 var type = this.method.resolveType$2(node.type, false); | 3899 var type = this.method.resolveType$2(node.type, false); |
| 3891 for (var i = (0); | 3900 for (var i = (0); |
| 3892 i < node.names.get$length(); i++) { | 3901 i < node.names.get$length(); i++) { |
| 3893 if (i > (0)) { | 3902 if (i > (0)) { |
| 3894 this.writer.write(", "); | 3903 this.writer.write(", "); |
| 3895 } | 3904 } |
| 3896 var name = node.names.$index(i).get$name(); | 3905 var name = node.names[i].get$name(); |
| 3897 var value = this.visitValue(node.values.$index(i)); | 3906 var value = this.visitValue(node.values[i]); |
| 3898 if (isFinal && value == null) { | 3907 if (isFinal && value == null) { |
| 3899 $globals.world.error("no value specified for final variable", node.span); | 3908 $globals.world.error("no value specified for final variable", node.span); |
| 3900 } | 3909 } |
| 3901 var val = this._scope.create(name, type, node.names.$index(i).get$span(), is
Final, false); | 3910 var val = this._scope.create(name, type, node.names[i].get$span(), isFinal,
false); |
| 3902 if (value == null) { | 3911 if (value == null) { |
| 3903 if (this._scope.reentrant) { | 3912 if (this._scope.reentrant) { |
| 3904 this.writer.write(("" + val.get$code() + " = null")); | 3913 this.writer.write(("" + val.get$code() + " = null")); |
| 3905 } | 3914 } |
| 3906 else { | 3915 else { |
| 3907 this.writer.write(("" + val.get$code())); | 3916 this.writer.write(("" + val.get$code())); |
| 3908 } | 3917 } |
| 3909 } | 3918 } |
| 3910 else { | 3919 else { |
| 3911 value = value.convertTo$2(this, type); | 3920 value = value.convertTo$2(this, type); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4033 if (node.test != null) { | 4042 if (node.test != null) { |
| 4034 var test = $this.visitBool(node.test); | 4043 var test = $this.visitBool(node.test); |
| 4035 $this.writer.write((" " + test.get$code() + "; ")); | 4044 $this.writer.write((" " + test.get$code() + "; ")); |
| 4036 } | 4045 } |
| 4037 else { | 4046 else { |
| 4038 $this.writer.write("; "); | 4047 $this.writer.write("; "); |
| 4039 } | 4048 } |
| 4040 var needsComma = false; | 4049 var needsComma = false; |
| 4041 var $$list = node.step; | 4050 var $$list = node.step; |
| 4042 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4051 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4043 var s = $$list.$index($$i); | 4052 var s = $$list[$$i]; |
| 4044 if (needsComma) $this.writer.write(", "); | 4053 if (needsComma) $this.writer.write(", "); |
| 4045 var sv = $this.visitVoid(s); | 4054 var sv = $this.visitVoid(s); |
| 4046 $this.writer.write(sv.get$code()); | 4055 $this.writer.write(sv.get$code()); |
| 4047 needsComma = true; | 4056 needsComma = true; |
| 4048 } | 4057 } |
| 4049 $this.writer.write(") "); | 4058 $this.writer.write(") "); |
| 4050 $this._pushBlock(node.body, false); | 4059 $this._pushBlock(node.body, false); |
| 4051 node.body.visit($this); | 4060 node.body.visit($this); |
| 4052 $this._popBlock(node.body); | 4061 $this._popBlock(node.body); |
| 4053 }) | 4062 }) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4105 MethodGenerator.prototype._genStackTraceOf = function(trace, ex) { | 4114 MethodGenerator.prototype._genStackTraceOf = function(trace, ex) { |
| 4106 var result = this._invokeNative("_stackTraceOf", [ex]); | 4115 var result = this._invokeNative("_stackTraceOf", [ex]); |
| 4107 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + "
;")); | 4116 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + "
;")); |
| 4108 } | 4117 } |
| 4109 MethodGenerator.prototype.visitTryStatement = function(node) { | 4118 MethodGenerator.prototype.visitTryStatement = function(node) { |
| 4110 this.writer.enterBlock("try {"); | 4119 this.writer.enterBlock("try {"); |
| 4111 this._pushBlock(node.body, false); | 4120 this._pushBlock(node.body, false); |
| 4112 this.visitStatementsInBlock(node.body); | 4121 this.visitStatementsInBlock(node.body); |
| 4113 this._popBlock(node.body); | 4122 this._popBlock(node.body); |
| 4114 if (node.catches.get$length() == (1)) { | 4123 if (node.catches.get$length() == (1)) { |
| 4115 var catch_ = node.catches.$index((0)); | 4124 var catch_ = node.catches[(0)]; |
| 4116 this._pushBlock(catch_, false); | 4125 this._pushBlock(catch_, false); |
| 4117 var exType = this.method.resolveType$2(catch_.get$exception().get$type(), fa
lse); | 4126 var exType = this.method.resolveType$2(catch_.get$exception().get$type(), fa
lse); |
| 4118 var ex = this._scope.declare(catch_.get$exception()); | 4127 var ex = this._scope.declare(catch_.get$exception()); |
| 4119 this._scope.rethrow = ex.get$code(); | 4128 this._scope.rethrow = ex.get$code(); |
| 4120 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); | 4129 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); |
| 4121 if (catch_.get$trace() != null) { | 4130 if (catch_.get$trace() != null) { |
| 4122 var trace = this._scope.declare(catch_.get$trace()); | 4131 var trace = this._scope.declare(catch_.get$trace()); |
| 4123 this._genStackTraceOf(trace, ex); | 4132 this._genStackTraceOf(trace, ex); |
| 4124 } | 4133 } |
| 4125 this._genToDartException(ex); | 4134 this._genToDartException(ex); |
| 4126 if (!exType.get$isVarOrObject()) { | 4135 if (!exType.get$isVarOrObject()) { |
| 4127 var test = ex.instanceOf$3$isTrue$forceCheck(this, exType, catch_.get$exce
ption().get$span(), false, true); | 4136 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()
+ ";")); | 4137 this.writer.writeln(("if (" + test.get$code() + ") throw " + ex.get$code()
+ ";")); |
| 4129 } | 4138 } |
| 4130 this.visitStatementsInBlock(node.catches.$index((0)).get$body()); | 4139 this.visitStatementsInBlock(node.catches[(0)].get$body()); |
| 4131 this._popBlock(catch_); | 4140 this._popBlock(catch_); |
| 4132 } | 4141 } |
| 4133 else if (node.catches.get$length() > (0)) { | 4142 else if (node.catches.get$length() > (0)) { |
| 4134 this._pushBlock(node, false); | 4143 this._pushBlock(node, false); |
| 4135 var ex = this._scope.create("$ex", $globals.world.varType, null, false, fals
e); | 4144 var ex = this._scope.create("$ex", $globals.world.varType, null, false, fals
e); |
| 4136 this._scope.rethrow = ex.get$code(); | 4145 this._scope.rethrow = ex.get$code(); |
| 4137 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); | 4146 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); |
| 4138 var trace = null; | 4147 var trace = null; |
| 4139 if (node.catches.some((function (c) { | 4148 if (node.catches.some((function (c) { |
| 4140 return c.get$trace() != null; | 4149 return c.get$trace() != null; |
| 4141 }) | 4150 }) |
| 4142 )) { | 4151 )) { |
| 4143 trace = this._scope.create("$trace", $globals.world.varType, null, false,
false); | 4152 trace = this._scope.create("$trace", $globals.world.varType, null, false,
false); |
| 4144 this._genStackTraceOf(trace, ex); | 4153 this._genStackTraceOf(trace, ex); |
| 4145 } | 4154 } |
| 4146 this._genToDartException(ex); | 4155 this._genToDartException(ex); |
| 4147 var needsRethrow = true; | 4156 var needsRethrow = true; |
| 4148 for (var i = (0); | 4157 for (var i = (0); |
| 4149 i < node.catches.get$length(); i++) { | 4158 i < node.catches.get$length(); i++) { |
| 4150 var catch_ = node.catches.$index(i); | 4159 var catch_ = node.catches[i]; |
| 4151 this._pushBlock(catch_, false); | 4160 this._pushBlock(catch_, false); |
| 4152 var tmpType = this.method.resolveType$2(catch_.get$exception().get$type(),
false); | 4161 var tmpType = this.method.resolveType$2(catch_.get$exception().get$type(),
false); |
| 4153 var tmp = this._scope.declare(catch_.get$exception()); | 4162 var tmp = this._scope.declare(catch_.get$exception()); |
| 4154 if (!tmpType.get$isVarOrObject()) { | 4163 if (!tmpType.get$isVarOrObject()) { |
| 4155 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e
xception().get$span(), true, true); | 4164 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e
xception().get$span(), true, true); |
| 4156 if (i == (0)) { | 4165 if (i == (0)) { |
| 4157 this.writer.enterBlock(("if (" + test.get$code() + ") {")); | 4166 this.writer.enterBlock(("if (" + test.get$code() + ") {")); |
| 4158 } | 4167 } |
| 4159 else { | 4168 else { |
| 4160 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); | 4169 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); |
| 4161 } | 4170 } |
| 4162 } | 4171 } |
| 4163 else if (i > (0)) { | 4172 else if (i > (0)) { |
| 4164 this.writer.nextBlock("} else {"); | 4173 this.writer.nextBlock("} else {"); |
| 4165 } | 4174 } |
| 4166 this.writer.writeln(("var " + tmp.get$code() + " = " + ex.get$code() + ";"
)); | 4175 this.writer.writeln(("var " + tmp.get$code() + " = " + ex.get$code() + ";"
)); |
| 4167 if (catch_.get$trace() != null) { | 4176 if (catch_.get$trace() != null) { |
| 4168 var tmptrace = this._scope.declare(catch_.get$trace()); | 4177 var tmptrace = this._scope.declare(catch_.get$trace()); |
| 4169 this.writer.writeln(("var " + tmptrace.get$code() + " = " + trace.get$co
de() + ";")); | 4178 this.writer.writeln(("var " + tmptrace.get$code() + " = " + trace.get$co
de() + ";")); |
| 4170 } | 4179 } |
| 4171 this.visitStatementsInBlock(catch_.get$body()); | 4180 this.visitStatementsInBlock(catch_.get$body()); |
| 4172 this._popBlock(catch_); | 4181 this._popBlock(catch_); |
| 4173 if (tmpType.get$isVarOrObject()) { | 4182 if (tmpType.get$isVarOrObject()) { |
| 4174 if (i + (1) < node.catches.get$length()) { | 4183 if ($add(i, (1)) < node.catches.get$length()) { |
| 4175 $globals.world.error("Unreachable catch clause", node.catches.$index(i
+ (1)).get$span()); | 4184 $globals.world.error("Unreachable catch clause", node.catches[$add(i,
(1))].get$span()); |
| 4176 } | 4185 } |
| 4177 if (i > (0)) { | 4186 if (i > (0)) { |
| 4178 this.writer.exitBlock("}"); | 4187 this.writer.exitBlock("}"); |
| 4179 } | 4188 } |
| 4180 needsRethrow = false; | 4189 needsRethrow = false; |
| 4181 break; | 4190 break; |
| 4182 } | 4191 } |
| 4183 } | 4192 } |
| 4184 if (needsRethrow) { | 4193 if (needsRethrow) { |
| 4185 this.writer.nextBlock("} else {"); | 4194 this.writer.nextBlock("} else {"); |
| 4186 this.writer.writeln(("throw " + ex.get$code() + ";")); | 4195 this.writer.writeln(("throw " + ex.get$code() + ";")); |
| 4187 this.writer.exitBlock("}"); | 4196 this.writer.exitBlock("}"); |
| 4188 } | 4197 } |
| 4189 this._popBlock(node); | 4198 this._popBlock(node); |
| 4190 } | 4199 } |
| 4191 if (node.finallyBlock != null) { | 4200 if (node.finallyBlock != null) { |
| 4192 this.writer.nextBlock("} finally {"); | 4201 this.writer.nextBlock("} finally {"); |
| 4193 this._pushBlock(node.finallyBlock, false); | 4202 this._pushBlock(node.finallyBlock, false); |
| 4194 this.visitStatementsInBlock(node.finallyBlock); | 4203 this.visitStatementsInBlock(node.finallyBlock); |
| 4195 this._popBlock(node.finallyBlock); | 4204 this._popBlock(node.finallyBlock); |
| 4196 } | 4205 } |
| 4197 this.writer.exitBlock("}"); | 4206 this.writer.exitBlock("}"); |
| 4198 return false; | 4207 return false; |
| 4199 } | 4208 } |
| 4200 MethodGenerator.prototype.visitSwitchStatement = function(node) { | 4209 MethodGenerator.prototype.visitSwitchStatement = function(node) { |
| 4201 var test = this.visitValue(node.test); | 4210 var test = this.visitValue(node.test); |
| 4202 this.writer.enterBlock(("switch (" + test.get$code() + ") {")); | 4211 this.writer.enterBlock(("switch (" + test.get$code() + ") {")); |
| 4203 var $$list = node.cases; | 4212 var $$list = node.cases; |
| 4204 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4213 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4205 var case_ = $$list.$index($$i); | 4214 var case_ = $$list[$$i]; |
| 4206 if (case_.get$label() != null) { | 4215 if (case_.get$label() != null) { |
| 4207 $globals.world.error("unimplemented: labeled case statement", case_.get$sp
an()); | 4216 $globals.world.error("unimplemented: labeled case statement", case_.get$sp
an()); |
| 4208 } | 4217 } |
| 4209 this._pushBlock(case_, false); | 4218 this._pushBlock(case_, false); |
| 4210 for (var i = (0); | 4219 for (var i = (0); |
| 4211 i < case_.get$cases().get$length(); i++) { | 4220 i < case_.get$cases().get$length(); i++) { |
| 4212 var expr = case_.get$cases().$index(i); | 4221 var expr = case_.get$cases().$index(i); |
| 4213 if (expr == null) { | 4222 if (expr == null) { |
| 4214 if (i < case_.get$cases().get$length() - (1)) { | 4223 if (i < case_.get$cases().get$length() - (1)) { |
| 4215 $globals.world.error("default clause must be the last case", case_.get
$span()); | 4224 $globals.world.error("default clause must be the last case", case_.get
$span()); |
| 4216 } | 4225 } |
| 4217 this.writer.writeln("default:"); | 4226 this.writer.writeln("default:"); |
| 4218 } | 4227 } |
| 4219 else { | 4228 else { |
| 4220 var value = this.visitValue(expr); | 4229 var value = this.visitValue(expr); |
| 4221 this.writer.writeln(("case " + value.get$code() + ":")); | 4230 this.writer.writeln(("case " + value.get$code() + ":")); |
| 4222 } | 4231 } |
| 4223 } | 4232 } |
| 4224 this.writer.enterBlock(""); | 4233 this.writer.enterBlock(""); |
| 4225 var caseExits = this._visitAllStatements(case_.get$statements(), false); | 4234 var caseExits = this._visitAllStatements(case_.get$statements(), false); |
| 4226 if ($ne(case_, node.cases.$index(node.cases.get$length() - (1))) && !caseExi
ts) { | 4235 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(); | 4236 var span = case_.get$statements().$index(case_.get$statements().get$length
() - (1)).get$span(); |
| 4228 this.writer.writeln("$throw(new FallThroughError());"); | 4237 this.writer.writeln("$throw(new FallThroughError());"); |
| 4229 $globals.world.gen.corejs.useThrow = true; | 4238 $globals.world.gen.corejs.useThrow = true; |
| 4230 } | 4239 } |
| 4231 this.writer.exitBlock(""); | 4240 this.writer.exitBlock(""); |
| 4232 this._popBlock(case_); | 4241 this._popBlock(case_); |
| 4233 } | 4242 } |
| 4234 this.writer.exitBlock("}"); | 4243 this.writer.exitBlock("}"); |
| 4235 return false; | 4244 return false; |
| 4236 } | 4245 } |
| 4237 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { | 4246 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { |
| 4238 for (var i = (0); | 4247 for (var i = (0); |
| 4239 i < statementList.get$length(); i++) { | 4248 i < statementList.get$length(); i++) { |
| 4240 var stmt = statementList.$index(i); | 4249 var stmt = statementList.$index(i); |
| 4241 exits = stmt.visit$1(this); | 4250 exits = stmt.visit$1(this); |
| 4242 if ($ne(stmt, statementList.$index(statementList.get$length() - (1))) && exi
ts) { | 4251 if ($ne(stmt, statementList.$index(statementList.get$length() - (1))) && exi
ts) { |
| 4243 $globals.world.warning("unreachable code", statementList.$index(i + (1)).g
et$span()); | 4252 $globals.world.warning("unreachable code", statementList.$index($add(i, (1
))).get$span()); |
| 4244 } | 4253 } |
| 4245 } | 4254 } |
| 4246 return exits; | 4255 return exits; |
| 4247 } | 4256 } |
| 4248 MethodGenerator.prototype.visitBlockStatement = function(node) { | 4257 MethodGenerator.prototype.visitBlockStatement = function(node) { |
| 4249 this._pushBlock(node, false); | 4258 this._pushBlock(node, false); |
| 4250 this.writer.enterBlock("{"); | 4259 this.writer.enterBlock("{"); |
| 4251 var exits = this._visitAllStatements(node.body, false); | 4260 var exits = this._visitAllStatements(node.body, false); |
| 4252 this.writer.exitBlock("}"); | 4261 this.writer.exitBlock("}"); |
| 4253 this._popBlock(node); | 4262 this._popBlock(node); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4369 var y = this.visitValue(node.y); | 4378 var y = this.visitValue(node.y); |
| 4370 return x.binop$4(kind, y, this, node); | 4379 return x.binop$4(kind, y, this, node); |
| 4371 } | 4380 } |
| 4372 var assignKind = TokenKind.kindFromAssign(node.op.kind); | 4381 var assignKind = TokenKind.kindFromAssign(node.op.kind); |
| 4373 if ($eq(assignKind, (-1))) { | 4382 if ($eq(assignKind, (-1))) { |
| 4374 var x = this.visitValue(node.x); | 4383 var x = this.visitValue(node.x); |
| 4375 var y = this.visitValue(node.y); | 4384 var y = this.visitValue(node.y); |
| 4376 return x.binop$4(kind, y, this, node); | 4385 return x.binop$4(kind, y, this, node); |
| 4377 } | 4386 } |
| 4378 else if (($ne(assignKind, (0))) && this._expressionNeedsParens(node.y)) { | 4387 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); | 4388 return this._visitAssign(assignKind, node.x, new ParenExpression(node.y, nod
e.y.span), node, isVoid ? (1) : (2)); |
| 4380 } | 4389 } |
| 4381 else { | 4390 else { |
| 4382 return this._visitAssign(assignKind, node.x, node.y, node, to$call$1(null),
isVoid); | 4391 return this._visitAssign(assignKind, node.x, node.y, node, isVoid ? (1) : (2
)); |
| 4383 } | 4392 } |
| 4384 } | 4393 } |
| 4385 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captur
eOriginal, isVoid) { | 4394 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)) { | 4395 if ((xn instanceof VarExpression)) { |
| 4393 return this._visitVarAssign(kind, xn, yn, position, captureOriginal); | 4396 return this._visitVarAssign(kind, xn, yn, position, returnKind); |
| 4394 } | 4397 } |
| 4395 else if ((xn instanceof IndexExpression)) { | 4398 else if ((xn instanceof IndexExpression)) { |
| 4396 return this._visitIndexAssign(kind, xn, yn, position, captureOriginal, isVoi
d); | 4399 return this._visitIndexAssign(kind, xn, yn, position, returnKind); |
| 4397 } | 4400 } |
| 4398 else if ((xn instanceof DotExpression)) { | 4401 else if ((xn instanceof DotExpression)) { |
| 4399 return this._visitDotAssign(kind, xn, yn, position, captureOriginal); | 4402 return this._visitDotAssign(kind, xn, yn, position, returnKind); |
| 4400 } | 4403 } |
| 4401 else { | 4404 else { |
| 4402 $globals.world.error("illegal lhs", xn.span); | 4405 $globals.world.error("illegal lhs", xn.span); |
| 4403 } | 4406 } |
| 4404 } | 4407 } |
| 4405 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap
tureOriginal) { | 4408 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, ret
urnKind) { |
| 4406 var name = xn.name.name; | 4409 var name = xn.name.name; |
| 4407 var x = this._scope.lookup(name); | 4410 var x = this._scope.lookup(name); |
| 4408 var y = this.visitValue(yn); | 4411 var y = this.visitValue(yn); |
| 4409 if (x != null) { | 4412 if (x != null) { |
| 4410 y = y.convertTo$2(this, x.get$staticType()); | 4413 y = y.convertTo$2(this, x.get$staticType()); |
| 4411 this._scope.inferAssign(name, Value.union(x, y)); | 4414 this._scope.inferAssign(name, Value.union(x, y)); |
| 4415 if (x.get$isFinal()) { |
| 4416 $globals.world.error(("final variable \"" + x.get$code() + "\" is not assi
gnable"), position.span); |
| 4417 } |
| 4418 if (kind == (0)) { |
| 4419 return new Value(y.get$type(), ("" + x.get$code() + " = " + y.get$code()),
position.span); |
| 4420 } |
| 4421 else if (x.get$type().get$isNum() && y.get$type().get$isNum() && (kind != (4
6))) { |
| 4422 if (returnKind == (3)) { |
| 4423 $globals.world.internalError("should not be here", position.span); |
| 4424 } |
| 4425 var op = TokenKind.kindToString(kind); |
| 4426 return new Value(y.get$type(), ("" + x.get$code() + " " + op + "= " + y.ge
t$code()), position.span); |
| 4427 } |
| 4428 else { |
| 4429 var right = x; |
| 4430 y = right.binop$4(kind, y, this, position); |
| 4431 if (returnKind == (3)) { |
| 4432 var tmp = this.forceTemp(x); |
| 4433 var ret = new Value(x.get$type(), ("(" + tmp.get$code() + " = " + x.get$
code() + ", " + x.get$code() + " = " + y.get$code() + ", " + tmp.get$code() + ")
"), position.span); |
| 4434 this.freeTemp(tmp); |
| 4435 return ret; |
| 4436 } |
| 4437 else { |
| 4438 return new Value(x.get$type(), ("" + x.get$code() + " = " + y.get$code()
), position.span); |
| 4439 } |
| 4440 } |
| 4412 } | 4441 } |
| 4413 else { | 4442 else { |
| 4414 var members = this.method.declaringType.resolveMember(name); | |
| 4415 x = this._makeThisOrType(position.span); | 4443 x = this._makeThisOrType(position.span); |
| 4416 if (members != null) { | 4444 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 } | 4445 } |
| 4472 } | 4446 } |
| 4473 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, c
aptureOriginal, isVoid) { | 4447 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, r
eturnKind) { |
| 4474 var target = this.visitValue(xn.target); | 4448 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); | 4449 var index = this.visitValue(xn.index); |
| 4478 var tmpindex = index; | |
| 4479 if (kind != (0)) tmpindex = this.getTemp(index); | |
| 4480 var y = this.visitValue(yn); | 4450 var y = this.visitValue(yn); |
| 4481 if (kind != (0)) { | 4451 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 } | 4452 } |
| 4501 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, cap
tureOriginal) { | 4453 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, ret
urnKind) { |
| 4502 var target = xn.self.visit(this); | 4454 var target = xn.self.visit(this); |
| 4503 var y = this.visitValue(yn); | 4455 var y = this.visitValue(yn); |
| 4504 var tmptarget = target; | 4456 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 } | 4457 } |
| 4515 MethodGenerator.prototype.visitUnaryExpression = function(node) { | 4458 MethodGenerator.prototype.visitUnaryExpression = function(node) { |
| 4516 var value = this.visitValue(node.self); | 4459 var value = this.visitValue(node.self); |
| 4517 switch (node.op.kind) { | 4460 switch (node.op.kind) { |
| 4518 case (16): | 4461 case (16): |
| 4519 case (17): | 4462 case (17): |
| 4520 | 4463 |
| 4521 if (value.get$type().get$isNum()) { | 4464 if (value.get$type().get$isNum()) { |
| 4522 return new Value(value.get$type(), ("" + node.op + value.get$code()), no
de.span); | 4465 return new Value(value.get$type(), ("" + node.op + value.get$code()), no
de.span); |
| 4523 } | 4466 } |
| 4524 else { | 4467 else { |
| 4525 var kind = ((16) == node.op.kind ? (42) : (43)); | 4468 var kind = ((16) == node.op.kind ? (42) : (43)); |
| 4526 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.
span); | 4469 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); | 4470 var assignValue = this._visitAssign(kind, node.self, operand, node, (2))
; |
| 4528 return new Value(assignValue.get$type(), ("(" + assignValue.get$code() +
")"), node.span); | 4471 return new Value(assignValue.get$type(), ("(" + assignValue.get$code() +
")"), node.span); |
| 4529 } | 4472 } |
| 4530 | 4473 |
| 4531 } | 4474 } |
| 4532 return value.unop$3(node.op.kind, this, node); | 4475 return value.unop$3(node.op.kind, this, node); |
| 4533 } | 4476 } |
| 4534 MethodGenerator.prototype.visitDeclaredIdentifier = function(node) { | 4477 MethodGenerator.prototype.visitDeclaredIdentifier = function(node) { |
| 4535 $globals.world.error("Expected expression", node.span); | 4478 $globals.world.error("Expected expression", node.span); |
| 4536 } | 4479 } |
| 4537 MethodGenerator.prototype.visitAwaitExpression = function(node) { | 4480 MethodGenerator.prototype.visitAwaitExpression = function(node) { |
| 4538 $globals.world.internalError("Await expressions should have been eliminated be
fore code generation", node.span); | 4481 $globals.world.internalError("Await expressions should have been eliminated be
fore code generation", node.span); |
| 4539 } | 4482 } |
| 4540 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { | 4483 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { |
| 4541 var $this = this; // closure support | |
| 4542 var value = this.visitValue(node.body); | 4484 var value = this.visitValue(node.body); |
| 4543 if (value.get$type().get$isNum() && !value.get$isFinal()) { | 4485 if (value.get$type().get$isNum() && !value.get$isFinal()) { |
| 4544 return new Value(value.get$type(), ("" + value.get$code() + node.op), node.s
pan); | 4486 return new Value(value.get$type(), ("" + value.get$code() + node.op), node.s
pan); |
| 4545 } | 4487 } |
| 4546 var kind = ((16) == node.op.kind) ? (42) : (43); | 4488 var kind = ((16) == node.op.kind) ? (42) : (43); |
| 4547 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.span); | 4489 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.span); |
| 4548 var tmpleft = null, left = null; | 4490 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; | 4491 return ret; |
| 4567 } | 4492 } |
| 4568 MethodGenerator.prototype.visitNewExpression = function(node) { | 4493 MethodGenerator.prototype.visitNewExpression = function(node) { |
| 4569 var typeRef = node.type; | 4494 var typeRef = node.type; |
| 4570 var constructorName = ""; | 4495 var constructorName = ""; |
| 4571 if (node.name != null) { | 4496 if (node.name != null) { |
| 4572 constructorName = node.name.name; | 4497 constructorName = node.name.name; |
| 4573 } | 4498 } |
| 4574 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) &&
typeRef.get$names() != null) { | 4499 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) &&
typeRef.get$names() != null) { |
| 4575 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); | 4500 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4594 } | 4519 } |
| 4595 $globals.world.error(("no matching constructor for " + name), node.span); | 4520 $globals.world.error(("no matching constructor for " + name), node.span); |
| 4596 return this._makeMissingValue(name); | 4521 return this._makeMissingValue(name); |
| 4597 } | 4522 } |
| 4598 if (node.isConst) { | 4523 if (node.isConst) { |
| 4599 if (!m.get$isConst()) { | 4524 if (!m.get$isConst()) { |
| 4600 $globals.world.error("can't use const on a non-const constructor", node.sp
an); | 4525 $globals.world.error("can't use const on a non-const constructor", node.sp
an); |
| 4601 } | 4526 } |
| 4602 var $$list = node.arguments; | 4527 var $$list = node.arguments; |
| 4603 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4528 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4604 var arg = $$list.$index($$i); | 4529 var arg = $$list[$$i]; |
| 4605 if (!this.visitValue(arg.get$value()).get$isConst()) { | 4530 if (!this.visitValue(arg.get$value()).get$isConst()) { |
| 4606 $globals.world.error("const constructor expects const arguments", arg.ge
t$span()); | 4531 $globals.world.error("const constructor expects const arguments", arg.ge
t$span()); |
| 4607 } | 4532 } |
| 4608 } | 4533 } |
| 4609 } | 4534 } |
| 4610 var target = new TypeValue(type, typeRef.get$span()); | 4535 var target = new TypeValue(type, typeRef.get$span()); |
| 4611 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); | 4536 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); |
| 4612 } | 4537 } |
| 4613 MethodGenerator.prototype.visitListExpression = function(node) { | 4538 MethodGenerator.prototype.visitListExpression = function(node) { |
| 4614 var argValues = []; | 4539 var argValues = []; |
| 4615 var listType = $globals.world.listType; | 4540 var listType = $globals.world.listType; |
| 4616 var type = $globals.world.varType; | 4541 var type = $globals.world.varType; |
| 4617 if (node.itemType != null) { | 4542 if (node.itemType != null) { |
| 4618 type = this.method.resolveType$2(node.itemType, true); | 4543 type = this.method.resolveType$2(node.itemType, true); |
| 4619 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara
ms())) { | 4544 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara
ms())) { |
| 4620 $globals.world.error("type parameter cannot be used in const list literals
"); | 4545 $globals.world.error("type parameter cannot be used in const list literals
"); |
| 4621 } | 4546 } |
| 4622 listType = listType.getOrMakeConcreteType$1([type]); | 4547 listType = listType.getOrMakeConcreteType$1([type]); |
| 4623 } | 4548 } |
| 4624 var $$list = node.values; | 4549 var $$list = node.values; |
| 4625 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4550 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4626 var item = $$list.$index($$i); | 4551 var item = $$list[$$i]; |
| 4627 var arg = this.visitTypedValue(item, type); | 4552 var arg = this.visitTypedValue(item, type); |
| 4628 argValues.add$1(arg); | 4553 argValues.add$1(arg); |
| 4629 if (node.isConst && !arg.get$isConst()) { | 4554 if (node.isConst && !arg.get$isConst()) { |
| 4630 $globals.world.error("const list can only contain const values", arg.get$s
pan()); | 4555 $globals.world.error("const list can only contain const values", arg.get$s
pan()); |
| 4631 } | 4556 } |
| 4632 } | 4557 } |
| 4633 $globals.world.listFactoryType.markUsed(); | 4558 $globals.world.listFactoryType.markUsed(); |
| 4634 var ret = new ListValue(argValues, node.isConst, listType, node.span); | 4559 var ret = new ListValue(argValues, node.isConst, listType, node.span); |
| 4635 if (ret.get$isConst()) return ret.getGlobalValue$0(); | 4560 if (ret.get$isConst()) return ret.getGlobalValue$0(); |
| 4636 return ret; | 4561 return ret; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4653 } | 4578 } |
| 4654 } | 4579 } |
| 4655 valueType = this.method.resolveType$2(node.valueType, true); | 4580 valueType = this.method.resolveType$2(node.valueType, true); |
| 4656 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h
asTypeParams())) { | 4581 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h
asTypeParams())) { |
| 4657 $globals.world.error("type parameter cannot be used in const map literals"
); | 4582 $globals.world.error("type parameter cannot be used in const map literals"
); |
| 4658 } | 4583 } |
| 4659 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); | 4584 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); |
| 4660 } | 4585 } |
| 4661 for (var i = (0); | 4586 for (var i = (0); |
| 4662 i < node.items.get$length(); i += (2)) { | 4587 i < node.items.get$length(); i += (2)) { |
| 4663 var key = this.visitTypedValue(node.items.$index(i), keyType); | 4588 var key = this.visitTypedValue(node.items[i], keyType); |
| 4664 if (node.isConst && !key.get$isConst()) { | 4589 if (node.isConst && !key.get$isConst()) { |
| 4665 $globals.world.error("const map can only contain const keys", key.get$span
()); | 4590 $globals.world.error("const map can only contain const keys", key.get$span
()); |
| 4666 } | 4591 } |
| 4667 values.add$1(key); | 4592 values.add$1(key); |
| 4668 var value = this.visitTypedValue(node.items.$index(i + (1)), valueType); | 4593 var value = this.visitTypedValue(node.items[$add(i, (1))], valueType); |
| 4669 if (node.isConst && !value.get$isConst()) { | 4594 if (node.isConst && !value.get$isConst()) { |
| 4670 $globals.world.error("const map can only contain const values", value.get$
span()); | 4595 $globals.world.error("const map can only contain const values", value.get$
span()); |
| 4671 } | 4596 } |
| 4672 values.add$1(value); | 4597 values.add$1(value); |
| 4673 } | 4598 } |
| 4674 var ret = new MapValue(values, node.isConst, mapType, node.span); | 4599 var ret = new MapValue(values, node.isConst, mapType, node.span); |
| 4675 if (ret.get$isConst()) return ret.getGlobalValue$0(); | 4600 if (ret.get$isConst()) return ret.getGlobalValue$0(); |
| 4676 return ret; | 4601 return ret; |
| 4677 } | 4602 } |
| 4678 MethodGenerator.prototype.visitConditionalExpression = function(node) { | 4603 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); | 4647 return u.op.kind == (16) || u.op.kind == (17); |
| 4723 } | 4648 } |
| 4724 else { | 4649 else { |
| 4725 return false; | 4650 return false; |
| 4726 } | 4651 } |
| 4727 } | 4652 } |
| 4728 MethodGenerator.prototype.visitStringInterpExpression = function(node) { | 4653 MethodGenerator.prototype.visitStringInterpExpression = function(node) { |
| 4729 var items = []; | 4654 var items = []; |
| 4730 var $$list = node.pieces; | 4655 var $$list = node.pieces; |
| 4731 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4656 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4732 var item = $$list.$index($$i); | 4657 var item = $$list[$$i]; |
| 4733 var val = this.visitValue(item); | 4658 var val = this.visitValue(item); |
| 4734 val.invoke$4(this, "toString", item, Arguments.get$EMPTY()); | 4659 val.invoke$4(this, "toString", item, Arguments.get$EMPTY()); |
| 4735 var code = val.get$code(); | 4660 var code = val.get$code(); |
| 4736 if (this._expressionNeedsParens(item)) { | 4661 if (this._expressionNeedsParens(item)) { |
| 4737 code = ("(" + code + ")"); | 4662 code = ("(" + code + ")"); |
| 4738 } | 4663 } |
| 4739 if ($eq(items.get$length(), (0)) || ($ne(code, "''") && $ne(code, "\"\"")))
{ | 4664 if ($eq(items.get$length(), (0)) || ($ne(code, "''") && $ne(code, "\"\"")))
{ |
| 4740 items.add$1(code); | 4665 items.add$1(code); |
| 4741 } | 4666 } |
| 4742 } | 4667 } |
| 4743 return new Value($globals.world.stringType, ("(" + Strings.join(items, " + ")
+ ")"), node.span); | 4668 return new Value($globals.world.stringType, ("(" + Strings.join(items, " + ")
+ ")"), node.span); |
| 4744 } | 4669 } |
| 4745 MethodGenerator.prototype._checkNonStatic$1 = MethodGenerator.prototype._checkNo
nStatic; | 4670 MethodGenerator.prototype._checkNonStatic$1 = MethodGenerator.prototype._checkNo
nStatic; |
| 4746 MethodGenerator.prototype._pushBlock$1 = function($0) { | 4671 MethodGenerator.prototype._pushBlock$1 = function($0) { |
| 4747 return this._pushBlock($0, false); | 4672 return this._pushBlock($0, false); |
| 4748 }; | 4673 }; |
| 4749 MethodGenerator.prototype.evalBody$2 = MethodGenerator.prototype.evalBody; | 4674 MethodGenerator.prototype.evalBody$2 = MethodGenerator.prototype.evalBody; |
| 4750 MethodGenerator.prototype.run$0 = MethodGenerator.prototype.run; | 4675 MethodGenerator.prototype.run$0 = MethodGenerator.prototype.run; |
| 4676 MethodGenerator.prototype.visitAssertStatement$1 = MethodGenerator.prototype.vis
itAssertStatement; |
| 4751 MethodGenerator.prototype.visitBinaryExpression$1 = function($0) { | 4677 MethodGenerator.prototype.visitBinaryExpression$1 = function($0) { |
| 4752 return this.visitBinaryExpression($0, false); | 4678 return this.visitBinaryExpression($0, false); |
| 4753 }; | 4679 }; |
| 4680 MethodGenerator.prototype.visitBlockStatement$1 = MethodGenerator.prototype.visi
tBlockStatement; |
| 4681 MethodGenerator.prototype.visitBreakStatement$1 = MethodGenerator.prototype.visi
tBreakStatement; |
| 4682 MethodGenerator.prototype.visitContinueStatement$1 = MethodGenerator.prototype.v
isitContinueStatement; |
| 4683 MethodGenerator.prototype.visitDeclaredIdentifier$1 = MethodGenerator.prototype.
visitDeclaredIdentifier; |
| 4684 MethodGenerator.prototype.visitDietStatement$1 = MethodGenerator.prototype.visit
DietStatement; |
| 4685 MethodGenerator.prototype.visitDoStatement$1 = MethodGenerator.prototype.visitDo
Statement; |
| 4686 MethodGenerator.prototype.visitEmptyStatement$1 = MethodGenerator.prototype.visi
tEmptyStatement; |
| 4687 MethodGenerator.prototype.visitExpressionStatement$1 = MethodGenerator.prototype
.visitExpressionStatement; |
| 4688 MethodGenerator.prototype.visitForInStatement$1 = MethodGenerator.prototype.visi
tForInStatement; |
| 4689 MethodGenerator.prototype.visitForStatement$1 = MethodGenerator.prototype.visitF
orStatement; |
| 4690 MethodGenerator.prototype.visitFunctionDefinition$1 = MethodGenerator.prototype.
visitFunctionDefinition; |
| 4691 MethodGenerator.prototype.visitIfStatement$1 = MethodGenerator.prototype.visitIf
Statement; |
| 4692 MethodGenerator.prototype.visitIndexExpression$1 = MethodGenerator.prototype.vis
itIndexExpression; |
| 4693 MethodGenerator.prototype.visitLabeledStatement$1 = MethodGenerator.prototype.vi
sitLabeledStatement; |
| 4694 MethodGenerator.prototype.visitLambdaExpression$1 = MethodGenerator.prototype.vi
sitLambdaExpression; |
| 4695 MethodGenerator.prototype.visitLiteralExpression$1 = MethodGenerator.prototype.v
isitLiteralExpression; |
| 4696 MethodGenerator.prototype.visitMapExpression$1 = MethodGenerator.prototype.visit
MapExpression; |
| 4697 MethodGenerator.prototype.visitNewExpression$1 = MethodGenerator.prototype.visit
NewExpression; |
| 4754 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { | 4698 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { |
| 4755 return this.visitPostfixExpression($0, false); | 4699 return this.visitPostfixExpression($0, false); |
| 4756 }; | 4700 }; |
| 4701 MethodGenerator.prototype.visitReturnStatement$1 = MethodGenerator.prototype.vis
itReturnStatement; |
| 4702 MethodGenerator.prototype.visitSwitchStatement$1 = MethodGenerator.prototype.vis
itSwitchStatement; |
| 4703 MethodGenerator.prototype.visitThrowStatement$1 = MethodGenerator.prototype.visi
tThrowStatement; |
| 4704 MethodGenerator.prototype.visitTryStatement$1 = MethodGenerator.prototype.visitT
ryStatement; |
| 4705 MethodGenerator.prototype.visitVariableDefinition$1 = MethodGenerator.prototype.
visitVariableDefinition; |
| 4706 MethodGenerator.prototype.visitWhileStatement$1 = MethodGenerator.prototype.visi
tWhileStatement; |
| 4757 MethodGenerator.prototype.writeDefinition$2 = MethodGenerator.prototype.writeDef
inition; | 4707 MethodGenerator.prototype.writeDefinition$2 = MethodGenerator.prototype.writeDef
inition; |
| 4758 // ********** Code for Arguments ************** | 4708 // ********** Code for Arguments ************** |
| 4759 function Arguments(nodes, values) { | 4709 function Arguments(nodes, values) { |
| 4760 this.nodes = nodes; | 4710 this.nodes = nodes; |
| 4761 this.values = values; | 4711 this.values = values; |
| 4762 } | 4712 } |
| 4763 Arguments.Arguments$bare$factory = function(arity) { | 4713 Arguments.Arguments$bare$factory = function(arity) { |
| 4764 var values = []; | 4714 var values = []; |
| 4765 for (var i = (0); | 4715 for (var i = (0); |
| 4766 i < arity; i++) { | 4716 i < arity; i++) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4777 Arguments.prototype.get$nameCount = function() { | 4727 Arguments.prototype.get$nameCount = function() { |
| 4778 return this.get$length() - this.get$bareCount(); | 4728 return this.get$length() - this.get$bareCount(); |
| 4779 } | 4729 } |
| 4780 Arguments.prototype.get$hasNames = function() { | 4730 Arguments.prototype.get$hasNames = function() { |
| 4781 return this.get$bareCount() < this.get$length(); | 4731 return this.get$bareCount() < this.get$length(); |
| 4782 } | 4732 } |
| 4783 Arguments.prototype.get$length = function() { | 4733 Arguments.prototype.get$length = function() { |
| 4784 return this.values.get$length(); | 4734 return this.values.get$length(); |
| 4785 } | 4735 } |
| 4786 Arguments.prototype.getName = function(i) { | 4736 Arguments.prototype.getName = function(i) { |
| 4787 return this.nodes.$index(i).get$label().get$name(); | 4737 return this.nodes[i].get$label().get$name(); |
| 4788 } | 4738 } |
| 4789 Arguments.prototype.getIndexOfName = function(name) { | 4739 Arguments.prototype.getIndexOfName = function(name) { |
| 4790 for (var i = this.get$bareCount(); | 4740 for (var i = this.get$bareCount(); |
| 4791 i < this.get$length(); i++) { | 4741 i < this.get$length(); i++) { |
| 4792 if (this.getName(i) == name) { | 4742 if (this.getName(i) == name) { |
| 4793 return i; | 4743 return i; |
| 4794 } | 4744 } |
| 4795 } | 4745 } |
| 4796 return (-1); | 4746 return (-1); |
| 4797 } | 4747 } |
| 4798 Arguments.prototype.getValue = function(name) { | 4748 Arguments.prototype.getValue = function(name) { |
| 4799 var i = this.getIndexOfName(name); | 4749 var i = this.getIndexOfName(name); |
| 4800 return i >= (0) ? this.values.$index(i) : null; | 4750 return i >= (0) ? this.values[i] : null; |
| 4801 } | 4751 } |
| 4802 Arguments.prototype.get$bareCount = function() { | 4752 Arguments.prototype.get$bareCount = function() { |
| 4803 if (this._bareCount == null) { | 4753 if (this._bareCount == null) { |
| 4804 this._bareCount = this.get$length(); | 4754 this._bareCount = this.get$length(); |
| 4805 if (this.nodes != null) { | 4755 if (this.nodes != null) { |
| 4806 for (var i = (0); | 4756 for (var i = (0); |
| 4807 i < this.nodes.get$length(); i++) { | 4757 i < this.nodes.get$length(); i++) { |
| 4808 if (this.nodes.$index(i).get$label() != null) { | 4758 if (this.nodes[i].get$label() != null) { |
| 4809 this._bareCount = i; | 4759 this._bareCount = i; |
| 4810 break; | 4760 break; |
| 4811 } | 4761 } |
| 4812 } | 4762 } |
| 4813 } | 4763 } |
| 4814 } | 4764 } |
| 4815 return this._bareCount; | 4765 return this._bareCount; |
| 4816 } | 4766 } |
| 4817 Arguments.prototype.getCode = function() { | 4767 Arguments.prototype.getCode = function() { |
| 4818 var argsCode = []; | 4768 var argsCode = []; |
| 4819 for (var i = (0); | 4769 for (var i = (0); |
| 4820 i < this.get$length(); i++) { | 4770 i < this.get$length(); i++) { |
| 4821 argsCode.add$1(this.values.$index(i).get$code()); | 4771 argsCode.add$1(this.values[i].get$code()); |
| 4822 } | 4772 } |
| 4823 Arguments.removeTrailingNulls(argsCode); | 4773 Arguments.removeTrailingNulls(argsCode); |
| 4824 return Strings.join(argsCode, ", "); | 4774 return Strings.join(argsCode, ", "); |
| 4825 } | 4775 } |
| 4826 Arguments.removeTrailingNulls = function(argsCode) { | 4776 Arguments.removeTrailingNulls = function(argsCode) { |
| 4827 while (argsCode.get$length() > (0) && $eq(argsCode.last$0(), "null")) { | 4777 while (argsCode.get$length() > (0) && $eq(argsCode.last(), "null")) { |
| 4828 argsCode.removeLast$0(); | 4778 argsCode.removeLast(); |
| 4829 } | 4779 } |
| 4830 } | 4780 } |
| 4831 Arguments.prototype.getNames = function() { | 4781 Arguments.prototype.getNames = function() { |
| 4832 var names = []; | 4782 var names = []; |
| 4833 for (var i = this.get$bareCount(); | 4783 for (var i = this.get$bareCount(); |
| 4834 i < this.get$length(); i++) { | 4784 i < this.get$length(); i++) { |
| 4835 names.add$1(this.getName(i)); | 4785 names.add$1(this.getName(i)); |
| 4836 } | 4786 } |
| 4837 return names; | 4787 return names; |
| 4838 } | 4788 } |
| 4839 Arguments.prototype.toCallStubArgs = function() { | 4789 Arguments.prototype.toCallStubArgs = function() { |
| 4840 var result = []; | 4790 var result = []; |
| 4841 for (var i = (0); | 4791 for (var i = (0); |
| 4842 i < this.get$bareCount(); i++) { | 4792 i < this.get$bareCount(); i++) { |
| 4843 result.add$1(new VariableValue($globals.world.varType, ("$" + i), null, fals
e)); | 4793 result.add$1(new VariableValue($globals.world.varType, ("$" + i), null, fals
e)); |
| 4844 } | 4794 } |
| 4845 for (var i = this.get$bareCount(); | 4795 for (var i = this.get$bareCount(); |
| 4846 i < this.get$length(); i++) { | 4796 i < this.get$length(); i++) { |
| 4847 var name = this.getName(i); | 4797 var name = this.getName(i); |
| 4848 if (name == null) name = ("$" + i); | 4798 if (name == null) name = ("$" + i); |
| 4849 result.add$1(new VariableValue($globals.world.varType, name, null, false)); | 4799 result.add$1(new VariableValue($globals.world.varType, name, null, false)); |
| 4850 } | 4800 } |
| 4851 return new Arguments(this.nodes, result); | 4801 return new Arguments(this.nodes, result); |
| 4852 } | 4802 } |
| 4803 // ********** Code for ReturnKind ************** |
| 4804 function ReturnKind() {} |
| 4853 // ********** Code for LibraryImport ************** | 4805 // ********** Code for LibraryImport ************** |
| 4854 function LibraryImport(library, prefix, span) { | 4806 function LibraryImport(library, prefix, span) { |
| 4855 this.library = library; | 4807 this.library = library; |
| 4856 this.span = span; | 4808 this.span = span; |
| 4857 this.prefix = prefix; | 4809 this.prefix = prefix; |
| 4858 } | 4810 } |
| 4859 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; | 4811 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; |
| 4860 LibraryImport.prototype.get$library = function() { return this.library; }; | 4812 LibraryImport.prototype.get$library = function() { return this.library; }; |
| 4861 LibraryImport.prototype.get$span = function() { return this.span; }; | 4813 LibraryImport.prototype.get$span = function() { return this.span; }; |
| 4862 // ********** Code for Member ************** | 4814 // ********** Code for Member ************** |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4942 return $globals.world.nonNullBool; | 4894 return $globals.world.nonNullBool; |
| 4943 } | 4895 } |
| 4944 return t; | 4896 return t; |
| 4945 } | 4897 } |
| 4946 Member.prototype.get$definition = function() { | 4898 Member.prototype.get$definition = function() { |
| 4947 return null; | 4899 return null; |
| 4948 } | 4900 } |
| 4949 Member.prototype.get$parameters = function() { | 4901 Member.prototype.get$parameters = function() { |
| 4950 return []; | 4902 return []; |
| 4951 } | 4903 } |
| 4904 Member.prototype.get$preciseMemberSet = function() { |
| 4905 if (this._preciseMemberSet == null) { |
| 4906 this._preciseMemberSet = new MemberSet(this, false); |
| 4907 } |
| 4908 return this._preciseMemberSet; |
| 4909 } |
| 4910 Member.prototype.get$potentialMemberSet = function() { |
| 4911 if (this._potentialMemberSet == null) { |
| 4912 if (this.declaringType.get$isObject()) { |
| 4913 this._potentialMemberSet = $globals.world._members.$index(this.name); |
| 4914 return this._potentialMemberSet; |
| 4915 } |
| 4916 var mems = new HashSetImplementation(); |
| 4917 if (this.declaringType.get$isClass()) mems.add$1(this); |
| 4918 var $$list = this.declaringType.get$subtypes(); |
| 4919 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 4920 var subtype = $$i.next$0(); |
| 4921 if (!subtype.get$isClass()) continue; |
| 4922 var mem = subtype.get$members().$index(this.name); |
| 4923 if (mem != null) { |
| 4924 mems.add$1(mem); |
| 4925 } |
| 4926 else if (!this.declaringType.get$isClass()) { |
| 4927 mem = subtype.getMember$1(this.name); |
| 4928 if (mem != null) { |
| 4929 mems.add$1(mem); |
| 4930 } |
| 4931 } |
| 4932 } |
| 4933 if ($ne(mems.get$length(), (0))) { |
| 4934 for (var $$i = mems.iterator$0(); $$i.hasNext$0(); ) { |
| 4935 var mem = $$i.next$0(); |
| 4936 if (this._potentialMemberSet == null) { |
| 4937 this._potentialMemberSet = new MemberSet(mem, false); |
| 4938 } |
| 4939 else { |
| 4940 this._potentialMemberSet.add(mem); |
| 4941 } |
| 4942 } |
| 4943 } |
| 4944 } |
| 4945 return this._potentialMemberSet; |
| 4946 } |
| 4952 Member.prototype.canInvoke = function(context, args) { | 4947 Member.prototype.canInvoke = function(context, args) { |
| 4953 return this.get$canGet() && new Value(this.get$returnType(), null, null).canIn
voke(context, ":call", args); | 4948 return this.get$canGet() && new Value(this.get$returnType(), null, null).canIn
voke(context, ":call", args); |
| 4954 } | 4949 } |
| 4955 Member.prototype.invoke = function(context, node, target, args, isDynamic) { | 4950 Member.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 4956 var newTarget = this._get(context, node, target, isDynamic); | 4951 var newTarget = this._get(context, node, target, isDynamic); |
| 4957 return newTarget.invoke$5(context, ":call", node, args, isDynamic); | 4952 return newTarget.invoke$5(context, ":call", node, args, isDynamic); |
| 4958 } | 4953 } |
| 4959 Member.prototype.override = function(other) { | 4954 Member.prototype.override = function(other) { |
| 4960 if (this.get$isStatic()) { | 4955 if (this.get$isStatic()) { |
| 4961 $globals.world.error("static members can not hide parent members", this.get$
span(), other.get$span()); | 4956 $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(
); | 4975 var typeCode = this.declaringType == null ? (1) : this.declaringType.hashCode(
); |
| 4981 var nameCode = this.get$isConstructor() ? this.get$constructorName().hashCode(
) : this.name.hashCode(); | 4976 var nameCode = this.get$isConstructor() ? this.get$constructorName().hashCode(
) : this.name.hashCode(); |
| 4982 return (typeCode << (4)) ^ nameCode; | 4977 return (typeCode << (4)) ^ nameCode; |
| 4983 } | 4978 } |
| 4984 Member.prototype.$eq = function(other) { | 4979 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()); | 4980 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 } | 4981 } |
| 4987 Member.prototype._get$3 = Member.prototype._get; | 4982 Member.prototype._get$3 = Member.prototype._get; |
| 4988 Member.prototype._get$3$isDynamic = Member.prototype._get; | 4983 Member.prototype._get$3$isDynamic = Member.prototype._get; |
| 4989 Member.prototype._get$4 = Member.prototype._get; | 4984 Member.prototype._get$4 = Member.prototype._get; |
| 4990 Member.prototype._set$4 = Member.prototype._set; | |
| 4991 Member.prototype._set$4$isDynamic = Member.prototype._set; | 4985 Member.prototype._set$4$isDynamic = Member.prototype._set; |
| 4992 Member.prototype._set$5 = Member.prototype._set; | 4986 Member.prototype._set$5 = Member.prototype._set; |
| 4993 Member.prototype.canInvoke$2 = Member.prototype.canInvoke; | 4987 Member.prototype.canInvoke$2 = Member.prototype.canInvoke; |
| 4994 Member.prototype.computeValue$0 = Member.prototype.computeValue; | 4988 Member.prototype.computeValue$0 = Member.prototype.computeValue; |
| 4995 Member.prototype.hashCode$0 = Member.prototype.hashCode; | 4989 Member.prototype.hashCode$0 = Member.prototype.hashCode; |
| 4996 Member.prototype.invoke$4 = function($0, $1, $2, $3) { | 4990 Member.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 4997 return this.invoke($0, $1, $2, $3, false); | 4991 return this.invoke($0, $1, $2, $3, false); |
| 4998 }; | 4992 }; |
| 4999 Member.prototype.invoke$4$isDynamic = Member.prototype.invoke; | 4993 Member.prototype.invoke$4$isDynamic = Member.prototype.invoke; |
| 5000 Member.prototype.invoke$5 = Member.prototype.invoke; | 4994 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) { | 5073 Library.prototype._addMember = function(member) { |
| 5080 if (member.get$isPrivate()) { | 5074 if (member.get$isPrivate()) { |
| 5081 if (member.get$isStatic()) { | 5075 if (member.get$isStatic()) { |
| 5082 if (member.declaringType.get$isTop()) { | 5076 if (member.declaringType.get$isTop()) { |
| 5083 $globals.world._addTopName(member); | 5077 $globals.world._addTopName(member); |
| 5084 } | 5078 } |
| 5085 return; | 5079 return; |
| 5086 } | 5080 } |
| 5087 var mset = this._privateMembers.$index(member.name); | 5081 var mset = this._privateMembers.$index(member.name); |
| 5088 if (mset == null) { | 5082 if (mset == null) { |
| 5089 var $$list = $globals.world.libraries.getValues$0(); | 5083 var $$list = $globals.world.libraries.getValues(); |
| 5090 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5084 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5091 var lib = $$i.next$0(); | 5085 var lib = $$i.next$0(); |
| 5092 if (lib.get$_privateMembers().containsKey$1(member.get$jsname())) { | 5086 if (lib.get$_privateMembers().containsKey$1(member.get$jsname())) { |
| 5093 member._jsname = ("_" + this.get$jsname() + member.get$jsname()); | 5087 member._jsname = ("_" + this.get$jsname() + member.get$jsname()); |
| 5094 break; | 5088 break; |
| 5095 } | 5089 } |
| 5096 } | 5090 } |
| 5097 mset = new MemberSet(member, true); | 5091 mset = new MemberSet(member, true); |
| 5098 this._privateMembers.$setindex(member.name, mset); | 5092 this._privateMembers.$setindex(member.name, mset); |
| 5099 } | 5093 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5133 Library.prototype.findType = function(type) { | 5127 Library.prototype.findType = function(type) { |
| 5134 var result = this.findTypeByName(type.name.name); | 5128 var result = this.findTypeByName(type.name.name); |
| 5135 if (result == null) return null; | 5129 if (result == null) return null; |
| 5136 if (type.names != null) { | 5130 if (type.names != null) { |
| 5137 if (type.names.get$length() > (1)) { | 5131 if (type.names.get$length() > (1)) { |
| 5138 return null; | 5132 return null; |
| 5139 } | 5133 } |
| 5140 if (!result.get$isTop()) { | 5134 if (!result.get$isTop()) { |
| 5141 return null; | 5135 return null; |
| 5142 } | 5136 } |
| 5143 return result.get$library().findTypeByName(type.names.$index((0)).get$name()
); | 5137 return result.get$library().findTypeByName(type.names[(0)].get$name()); |
| 5144 } | 5138 } |
| 5145 return result; | 5139 return result; |
| 5146 } | 5140 } |
| 5147 Library.prototype.findTypeByName = function(name) { | 5141 Library.prototype.findTypeByName = function(name) { |
| 5148 var ret = this.types.$index(name); | 5142 var ret = this.types.$index(name); |
| 5149 var $$list = this.imports; | 5143 var $$list = this.imports; |
| 5150 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5144 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5151 var imported = $$list.$index($$i); | 5145 var imported = $$list[$$i]; |
| 5152 var newRet = null; | 5146 var newRet = null; |
| 5153 if (imported.get$prefix() == null) { | 5147 if (imported.get$prefix() == null) { |
| 5154 newRet = imported.get$library().get$types().$index(name); | 5148 newRet = imported.get$library().get$types().$index(name); |
| 5155 } | 5149 } |
| 5156 else if ($eq(imported.get$prefix(), name)) { | 5150 else if ($eq(imported.get$prefix(), name)) { |
| 5157 newRet = imported.get$library().get$topType(); | 5151 newRet = imported.get$library().get$topType(); |
| 5158 } | 5152 } |
| 5159 if (newRet != null) { | 5153 if (newRet != null) { |
| 5160 if (ret != null && $ne(ret, newRet)) { | 5154 if (ret != null && $ne(ret, newRet)) { |
| 5161 $globals.world.error(("conflicting types for \"" + name + "\""), ret.get
$span(), newRet.get$span()); | 5155 $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); | 5199 var index = this.name.lastIndexOf("/", this.name.length); |
| 5206 if (index >= (0)) { | 5200 if (index >= (0)) { |
| 5207 this.name = this.name.substring($add(index, (1))); | 5201 this.name = this.name.substring($add(index, (1))); |
| 5208 } | 5202 } |
| 5209 index = this.name.indexOf("."); | 5203 index = this.name.indexOf("."); |
| 5210 if (index > (0)) { | 5204 if (index > (0)) { |
| 5211 this.name = this.name.substring((0), index); | 5205 this.name = this.name.substring((0), index); |
| 5212 } | 5206 } |
| 5213 } | 5207 } |
| 5214 this._jsname = this.name.replaceAll(".", "_").replaceAll(":", "_").replaceAll(
" ", "_"); | 5208 this._jsname = this.name.replaceAll(".", "_").replaceAll(":", "_").replaceAll(
" ", "_"); |
| 5215 var $$list = this.types.getValues$0(); | 5209 var $$list = this.types.getValues(); |
| 5216 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5210 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5217 var type = $$i.next$0(); | 5211 var type = $$i.next$0(); |
| 5218 type.resolve$0(); | 5212 type.resolve$0(); |
| 5219 } | 5213 } |
| 5220 } | 5214 } |
| 5221 Library.prototype._addTopName = function(name, member, localSpan) { | 5215 Library.prototype._addTopName = function(name, member, localSpan) { |
| 5222 var existing = this._topNames.$index(name); | 5216 var existing = this._topNames.$index(name); |
| 5223 if (existing == null) { | 5217 if (existing == null) { |
| 5224 this._topNames.$setindex(name, member); | 5218 this._topNames.$setindex(name, member); |
| 5225 } | 5219 } |
| 5226 else { | 5220 else { |
| 5227 if ((existing instanceof AmbiguousMember)) { | 5221 if ((existing instanceof AmbiguousMember)) { |
| 5228 existing.get$members().add$1(member); | 5222 existing.get$members().add$1(member); |
| 5229 } | 5223 } |
| 5230 else { | 5224 else { |
| 5231 var newMember = new AmbiguousMember(name, [existing, member]); | 5225 var newMember = new AmbiguousMember(name, [existing, member]); |
| 5232 $globals.world.error(("conflicting members for \"" + name + "\""), existin
g.get$span(), member.get$span(), localSpan); | 5226 $globals.world.error(("conflicting members for \"" + name + "\""), existin
g.get$span(), member.get$span(), localSpan); |
| 5233 this._topNames.$setindex(name, newMember); | 5227 this._topNames.$setindex(name, newMember); |
| 5234 } | 5228 } |
| 5235 } | 5229 } |
| 5236 } | 5230 } |
| 5237 Library.prototype._addTopNames = function(lib) { | 5231 Library.prototype._addTopNames = function(lib) { |
| 5238 var $$list = lib.topType.members.getValues$0(); | 5232 var $$list = lib.topType.members.getValues(); |
| 5239 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5233 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5240 var member = $$i.next$0(); | 5234 var member = $$i.next$0(); |
| 5241 if (member.get$isPrivate() && $ne(lib, this)) continue; | 5235 if (member.get$isPrivate() && $ne(lib, this)) continue; |
| 5242 this._addTopName(member.get$name(), member); | 5236 this._addTopName(member.get$name(), member); |
| 5243 } | 5237 } |
| 5244 var $$list = lib.types.getValues$0(); | 5238 var $$list = lib.types.getValues(); |
| 5245 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5239 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5246 var type = $$i.next$0(); | 5240 var type = $$i.next$0(); |
| 5247 if (!type.get$isTop()) { | 5241 if (!type.get$isTop()) { |
| 5248 if ($ne(lib, this) && type.get$typeMember().get$isPrivate()) continue; | 5242 if ($ne(lib, this) && type.get$typeMember().get$isPrivate()) continue; |
| 5249 this._addTopName(type.get$name(), type.get$typeMember()); | 5243 this._addTopName(type.get$name(), type.get$typeMember()); |
| 5250 } | 5244 } |
| 5251 } | 5245 } |
| 5252 } | 5246 } |
| 5253 Library.prototype.postResolveChecks = function() { | 5247 Library.prototype.postResolveChecks = function() { |
| 5254 this._topNames = new HashMapImplementation(); | 5248 this._topNames = new HashMapImplementation(); |
| 5255 this._addTopNames(this); | 5249 this._addTopNames(this); |
| 5256 var $$list = this.imports; | 5250 var $$list = this.imports; |
| 5257 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5251 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5258 var imported = $$list.$index($$i); | 5252 var imported = $$list[$$i]; |
| 5259 if (imported.get$prefix() == null) { | 5253 if (imported.get$prefix() == null) { |
| 5260 this._addTopNames(imported.get$library()); | 5254 this._addTopNames(imported.get$library()); |
| 5261 } | 5255 } |
| 5262 else { | 5256 else { |
| 5263 this._addTopName(imported.get$prefix(), imported.get$library().get$topType
().get$typeMember(), imported.get$span()); | 5257 this._addTopName(imported.get$prefix(), imported.get$library().get$topType
().get$typeMember(), imported.get$span()); |
| 5264 } | 5258 } |
| 5265 } | 5259 } |
| 5266 } | 5260 } |
| 5267 Library.prototype.visitSources = function() { | 5261 Library.prototype.visitSources = function() { |
| 5268 var visitor = new _LibraryVisitor(this); | 5262 var visitor = new _LibraryVisitor(this); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5419 _LibraryVisitor.prototype.getSingleStringArg = function(node) { | 5413 _LibraryVisitor.prototype.getSingleStringArg = function(node) { |
| 5420 if (node.arguments.get$length() != (1)) { | 5414 if (node.arguments.get$length() != (1)) { |
| 5421 $globals.world.error(("expected exactly one argument but found " + node.argu
ments.get$length()), node.span); | 5415 $globals.world.error(("expected exactly one argument but found " + node.argu
ments.get$length()), node.span); |
| 5422 } | 5416 } |
| 5423 return this.getFirstStringArg(node); | 5417 return this.getFirstStringArg(node); |
| 5424 } | 5418 } |
| 5425 _LibraryVisitor.prototype.getFirstStringArg = function(node) { | 5419 _LibraryVisitor.prototype.getFirstStringArg = function(node) { |
| 5426 if (node.arguments.get$length() < (1)) { | 5420 if (node.arguments.get$length() < (1)) { |
| 5427 $globals.world.error(("expected at least one argument but found " + node.arg
uments.get$length()), node.span); | 5421 $globals.world.error(("expected at least one argument but found " + node.arg
uments.get$length()), node.span); |
| 5428 } | 5422 } |
| 5429 var arg = node.arguments.$index((0)); | 5423 var arg = node.arguments[(0)]; |
| 5430 if (arg.get$label() != null) { | 5424 if (arg.get$label() != null) { |
| 5431 $globals.world.error("label not allowed for directive", node.span); | 5425 $globals.world.error("label not allowed for directive", node.span); |
| 5432 } | 5426 } |
| 5433 return this._parseStringArgument(arg); | 5427 return this._parseStringArgument(arg); |
| 5434 } | 5428 } |
| 5435 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { | 5429 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { |
| 5436 var args = node.arguments.filter$1((function (a) { | 5430 var args = node.arguments.filter$1((function (a) { |
| 5437 return a.get$label() != null && $eq(a.get$label().get$name(), argName); | 5431 return a.get$label() != null && $eq(a.get$label().get$name(), argName); |
| 5438 }) | 5432 }) |
| 5439 ); | 5433 ); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 5453 if (!(expr instanceof LiteralExpression) || !expr.get$value().get$type().get$i
sString()) { | 5447 if (!(expr instanceof LiteralExpression) || !expr.get$value().get$type().get$i
sString()) { |
| 5454 $globals.world.error("expected string literal", expr.get$span()); | 5448 $globals.world.error("expected string literal", expr.get$span()); |
| 5455 } | 5449 } |
| 5456 return expr.get$value().get$actualValue(); | 5450 return expr.get$value().get$actualValue(); |
| 5457 } | 5451 } |
| 5458 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { | 5452 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { |
| 5459 var oldType = this.currentType; | 5453 var oldType = this.currentType; |
| 5460 this.currentType = this.library.addType(node.name.name, node, node.isClass); | 5454 this.currentType = this.library.addType(node.name.name, node, node.isClass); |
| 5461 var $$list = node.body; | 5455 var $$list = node.body; |
| 5462 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5456 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5463 var member = $$list.$index($$i); | 5457 var member = $$list[$$i]; |
| 5464 member.visit$1(this); | 5458 member.visit$1(this); |
| 5465 } | 5459 } |
| 5466 this.currentType = oldType; | 5460 this.currentType = oldType; |
| 5467 } | 5461 } |
| 5468 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { | 5462 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { |
| 5469 this.currentType.addField(node); | 5463 this.currentType.addField(node); |
| 5470 } | 5464 } |
| 5471 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { | 5465 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { |
| 5472 this.currentType.addMethod(node.name.name, node); | 5466 this.currentType.addMethod(node.name.name, node); |
| 5473 } | 5467 } |
| 5474 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { | 5468 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { |
| 5475 var type = this.library.addType(node.func.name.name, node, false); | 5469 var type = this.library.addType(node.func.name.name, node, false); |
| 5476 type.addMethod$2(":call", node.func); | 5470 type.addMethod$2(":call", node.func); |
| 5477 } | 5471 } |
| 5478 _LibraryVisitor.prototype.addSource$1 = _LibraryVisitor.prototype.addSource; | 5472 _LibraryVisitor.prototype.addSource$1 = _LibraryVisitor.prototype.addSource; |
| 5473 _LibraryVisitor.prototype.visitFunctionDefinition$1 = _LibraryVisitor.prototype.
visitFunctionDefinition; |
| 5474 _LibraryVisitor.prototype.visitVariableDefinition$1 = _LibraryVisitor.prototype.
visitVariableDefinition; |
| 5479 // ********** Code for Parameter ************** | 5475 // ********** Code for Parameter ************** |
| 5480 function Parameter(definition, method) { | 5476 function Parameter(definition, method) { |
| 5481 this.method = method; | 5477 this.method = method; |
| 5482 this.definition = definition; | 5478 this.definition = definition; |
| 5483 this.isInitializer = false; | 5479 this.isInitializer = false; |
| 5484 } | 5480 } |
| 5485 Parameter.prototype.get$definition = function() { return this.definition; }; | 5481 Parameter.prototype.get$definition = function() { return this.definition; }; |
| 5486 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; | 5482 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; |
| 5487 Parameter.prototype.get$method = function() { return this.method; }; | 5483 Parameter.prototype.get$method = function() { return this.method; }; |
| 5488 Parameter.prototype.set$method = function(value) { return this.method = value; }
; | 5484 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); | 5575 $globals.world.error("cannot set type", node.span); |
| 5580 } | 5576 } |
| 5581 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { | 5577 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 5582 $globals.world.error("cannot invoke type", node.span); | 5578 $globals.world.error("cannot invoke type", node.span); |
| 5583 } | 5579 } |
| 5584 TypeMember.prototype._get$3 = function($0, $1, $2) { | 5580 TypeMember.prototype._get$3 = function($0, $1, $2) { |
| 5585 return this._get($0, $1, $2, false); | 5581 return this._get($0, $1, $2, false); |
| 5586 }; | 5582 }; |
| 5587 TypeMember.prototype._get$3$isDynamic = TypeMember.prototype._get; | 5583 TypeMember.prototype._get$3$isDynamic = TypeMember.prototype._get; |
| 5588 TypeMember.prototype._get$4 = TypeMember.prototype._get; | 5584 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; | 5585 TypeMember.prototype._set$4$isDynamic = TypeMember.prototype._set; |
| 5593 TypeMember.prototype._set$5 = TypeMember.prototype._set; | 5586 TypeMember.prototype._set$5 = TypeMember.prototype._set; |
| 5594 TypeMember.prototype.canInvoke$2 = TypeMember.prototype.canInvoke; | 5587 TypeMember.prototype.canInvoke$2 = TypeMember.prototype.canInvoke; |
| 5595 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 5588 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 5596 return this.invoke($0, $1, $2, $3, false); | 5589 return this.invoke($0, $1, $2, $3, false); |
| 5597 }; | 5590 }; |
| 5598 TypeMember.prototype.invoke$4$isDynamic = TypeMember.prototype.invoke; | 5591 TypeMember.prototype.invoke$4$isDynamic = TypeMember.prototype.invoke; |
| 5599 TypeMember.prototype.invoke$5 = TypeMember.prototype.invoke; | 5592 TypeMember.prototype.invoke$5 = TypeMember.prototype.invoke; |
| 5600 // ********** Code for FieldMember ************** | 5593 // ********** Code for FieldMember ************** |
| 5601 $inherits(FieldMember, Member); | 5594 $inherits(FieldMember, Member); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5646 } | 5639 } |
| 5647 FieldMember.prototype.get$isField = function() { | 5640 FieldMember.prototype.get$isField = function() { |
| 5648 return true; | 5641 return true; |
| 5649 } | 5642 } |
| 5650 FieldMember.prototype.resolve = function() { | 5643 FieldMember.prototype.resolve = function() { |
| 5651 this.isStatic = this.declaringType.get$isTop(); | 5644 this.isStatic = this.declaringType.get$isTop(); |
| 5652 this.isFinal = false; | 5645 this.isFinal = false; |
| 5653 if (this.definition.modifiers != null) { | 5646 if (this.definition.modifiers != null) { |
| 5654 var $$list = this.definition.modifiers; | 5647 var $$list = this.definition.modifiers; |
| 5655 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5648 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5656 var mod = $$list.$index($$i); | 5649 var mod = $$list[$$i]; |
| 5657 if ($eq(mod.get$kind(), (85))) { | 5650 if ($eq(mod.get$kind(), (85))) { |
| 5658 if (this.isStatic) { | 5651 if (this.isStatic) { |
| 5659 $globals.world.error("duplicate static modifier", mod.get$span()); | 5652 $globals.world.error("duplicate static modifier", mod.get$span()); |
| 5660 } | 5653 } |
| 5661 this.isStatic = true; | 5654 this.isStatic = true; |
| 5662 } | 5655 } |
| 5663 else if ($eq(mod.get$kind(), (99))) { | 5656 else if ($eq(mod.get$kind(), (99))) { |
| 5664 if (this.isFinal) { | 5657 if (this.isFinal) { |
| 5665 $globals.world.error("duplicate final modifier", mod.get$span()); | 5658 $globals.world.error("duplicate final modifier", mod.get$span()); |
| 5666 } | 5659 } |
| 5667 this.isFinal = true; | 5660 this.isFinal = true; |
| 5668 } | 5661 } |
| 5669 else { | 5662 else { |
| 5670 $globals.world.error(("" + mod + " modifier not allowed on field"), mod.
get$span()); | 5663 $globals.world.error(("" + mod + " modifier not allowed on field"), mod.
get$span()); |
| 5671 } | 5664 } |
| 5672 } | 5665 } |
| 5673 } | 5666 } |
| 5674 this.type = this.resolveType(this.definition.type, false); | 5667 this.type = this.resolveType$2(this.definition.type, false); |
| 5675 if (this.isStatic && !this.get$isFactory() && this.type.get$hasTypeParams()) { | 5668 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); | 5669 $globals.world.error("using type parameter in static context", this.definiti
on.type.span); |
| 5677 } | 5670 } |
| 5678 if (this.isStatic && this.isFinal && this.value == null) { | 5671 if (this.isStatic && this.isFinal && this.value == null) { |
| 5679 $globals.world.error("static final field is missing initializer", this.get$s
pan()); | 5672 $globals.world.error("static final field is missing initializer", this.get$s
pan()); |
| 5680 } | 5673 } |
| 5681 this.get$library()._addMember(this); | 5674 this.get$library()._addMember(this); |
| 5682 } | 5675 } |
| 5683 FieldMember.prototype.computeValue = function() { | 5676 FieldMember.prototype.computeValue = function() { |
| 5684 if (this.value == null) return null; | 5677 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) { | 5745 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { |
| 5753 var lhs = this._get(context, node, target, isDynamic); | 5746 var lhs = this._get(context, node, target, isDynamic); |
| 5754 value = value.convertTo(context, this.type, isDynamic); | 5747 value = value.convertTo(context, this.type, isDynamic); |
| 5755 return new Value(this.type, ("" + lhs.get$code() + " = " + value.get$code()),
node.span); | 5748 return new Value(this.type, ("" + lhs.get$code() + " = " + value.get$code()),
node.span); |
| 5756 } | 5749 } |
| 5757 FieldMember.prototype._get$3 = function($0, $1, $2) { | 5750 FieldMember.prototype._get$3 = function($0, $1, $2) { |
| 5758 return this._get($0, $1, $2, false); | 5751 return this._get($0, $1, $2, false); |
| 5759 }; | 5752 }; |
| 5760 FieldMember.prototype._get$3$isDynamic = FieldMember.prototype._get; | 5753 FieldMember.prototype._get$3$isDynamic = FieldMember.prototype._get; |
| 5761 FieldMember.prototype._get$4 = FieldMember.prototype._get; | 5754 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; | 5755 FieldMember.prototype._set$4$isDynamic = FieldMember.prototype._set; |
| 5766 FieldMember.prototype._set$5 = FieldMember.prototype._set; | 5756 FieldMember.prototype._set$5 = FieldMember.prototype._set; |
| 5767 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; | 5757 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; |
| 5768 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS
yntax; | 5758 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS
yntax; |
| 5769 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro
pertySyntax; | 5759 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro
pertySyntax; |
| 5770 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; | 5760 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; |
| 5771 // ********** Code for PropertyMember ************** | 5761 // ********** Code for PropertyMember ************** |
| 5772 $inherits(PropertyMember, Member); | 5762 $inherits(PropertyMember, Member); |
| 5773 function PropertyMember(name, declaringType) { | 5763 function PropertyMember(name, declaringType) { |
| 5774 Member.call(this, name, declaringType); | 5764 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); | 5857 $globals.world.warning("setter methods should be void", this.setter.defini
tion.returnType.span); |
| 5868 } | 5858 } |
| 5869 } | 5859 } |
| 5870 this.get$library()._addMember(this); | 5860 this.get$library()._addMember(this); |
| 5871 } | 5861 } |
| 5872 PropertyMember.prototype._get$3 = function($0, $1, $2) { | 5862 PropertyMember.prototype._get$3 = function($0, $1, $2) { |
| 5873 return this._get($0, $1, $2, false); | 5863 return this._get($0, $1, $2, false); |
| 5874 }; | 5864 }; |
| 5875 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get; | 5865 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get; |
| 5876 PropertyMember.prototype._get$4 = PropertyMember.prototype._get; | 5866 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; | 5867 PropertyMember.prototype._set$4$isDynamic = PropertyMember.prototype._set; |
| 5881 PropertyMember.prototype._set$5 = PropertyMember.prototype._set; | 5868 PropertyMember.prototype._set$5 = PropertyMember.prototype._set; |
| 5882 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide
FieldSyntax; | 5869 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide
FieldSyntax; |
| 5883 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov
idePropertySyntax; | 5870 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov
idePropertySyntax; |
| 5884 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; | 5871 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; |
| 5885 // ********** Code for ConcreteMember ************** | 5872 // ********** Code for ConcreteMember ************** |
| 5886 $inherits(ConcreteMember, Member); | 5873 $inherits(ConcreteMember, Member); |
| 5887 function ConcreteMember(name, declaringType, baseMember) { | 5874 function ConcreteMember(name, declaringType, baseMember) { |
| 5888 this.baseMember = baseMember; | 5875 this.baseMember = baseMember; |
| 5889 Member.call(this, name, declaringType); | 5876 Member.call(this, name, declaringType); |
| 5890 this.parameters = []; | 5877 this.parameters = []; |
| 5891 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type); | 5878 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type); |
| 5892 var $$list = this.baseMember.get$parameters(); | 5879 var $$list = this.baseMember.get$parameters(); |
| 5893 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5880 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5894 var p = $$list.$index($$i); | 5881 var p = $$list[$$i]; |
| 5895 var newType = p.get$type().resolveTypeParams$1(declaringType); | 5882 var newType = p.get$type().resolveTypeParams$1(declaringType); |
| 5896 if ($ne(newType, p.get$type())) { | 5883 if ($ne(newType, p.get$type())) { |
| 5897 this.parameters.add(p.copyWithNewType$2(this, newType)); | 5884 this.parameters.add(p.copyWithNewType$2(this, newType)); |
| 5898 } | 5885 } |
| 5899 else { | 5886 else { |
| 5900 this.parameters.add(p); | 5887 this.parameters.add(p); |
| 5901 } | 5888 } |
| 5902 } | 5889 } |
| 5903 } | 5890 } |
| 5904 ConcreteMember.prototype.get$returnType = function() { return this.returnType; }
; | 5891 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); | 5992 this.declaringType.genMethod(this); |
| 6006 } | 5993 } |
| 6007 return new Value(this.get$inferredResult(), code, node.span); | 5994 return new Value(this.get$inferredResult(), code, node.span); |
| 6008 } | 5995 } |
| 6009 ConcreteMember.prototype._evalConstConstructor$2 = ConcreteMember.prototype._eva
lConstConstructor; | 5996 ConcreteMember.prototype._evalConstConstructor$2 = ConcreteMember.prototype._eva
lConstConstructor; |
| 6010 ConcreteMember.prototype._get$3 = function($0, $1, $2) { | 5997 ConcreteMember.prototype._get$3 = function($0, $1, $2) { |
| 6011 return this._get($0, $1, $2, false); | 5998 return this._get($0, $1, $2, false); |
| 6012 }; | 5999 }; |
| 6013 ConcreteMember.prototype._get$3$isDynamic = ConcreteMember.prototype._get; | 6000 ConcreteMember.prototype._get$3$isDynamic = ConcreteMember.prototype._get; |
| 6014 ConcreteMember.prototype._get$4 = ConcreteMember.prototype._get; | 6001 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; | 6002 ConcreteMember.prototype._set$4$isDynamic = ConcreteMember.prototype._set; |
| 6019 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; | 6003 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; |
| 6020 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; | 6004 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; |
| 6021 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; | 6005 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; |
| 6022 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 6006 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6023 return this.invoke($0, $1, $2, $3, false); | 6007 return this.invoke($0, $1, $2, $3, false); |
| 6024 }; | 6008 }; |
| 6025 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; | 6009 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; |
| 6026 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; | 6010 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; |
| 6027 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide
FieldSyntax; | 6011 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide
FieldSyntax; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6111 return false; | 6095 return false; |
| 6112 } | 6096 } |
| 6113 } | 6097 } |
| 6114 MethodMember.prototype.canInvoke = function(context, args) { | 6098 MethodMember.prototype.canInvoke = function(context, args) { |
| 6115 var bareCount = args.get$bareCount(); | 6099 var bareCount = args.get$bareCount(); |
| 6116 if (bareCount > this.parameters.get$length()) return false; | 6100 if (bareCount > this.parameters.get$length()) return false; |
| 6117 if (bareCount == this.parameters.get$length()) { | 6101 if (bareCount == this.parameters.get$length()) { |
| 6118 if (bareCount != args.get$length()) return false; | 6102 if (bareCount != args.get$length()) return false; |
| 6119 } | 6103 } |
| 6120 else { | 6104 else { |
| 6121 if (!this.parameters.$index(bareCount).get$isOptional()) return false; | 6105 if (!this.parameters[bareCount].get$isOptional()) return false; |
| 6122 for (var i = bareCount; | 6106 for (var i = bareCount; |
| 6123 i < args.get$length(); i++) { | 6107 i < args.get$length(); i++) { |
| 6124 if (this.indexOfParameter(args.getName(i)) < (0)) { | 6108 if (this.indexOfParameter(args.getName(i)) < (0)) { |
| 6125 return false; | 6109 return false; |
| 6126 } | 6110 } |
| 6127 } | 6111 } |
| 6128 } | 6112 } |
| 6129 return true; | 6113 return true; |
| 6130 } | 6114 } |
| 6131 MethodMember.prototype.indexOfParameter = function(name) { | 6115 MethodMember.prototype.indexOfParameter = function(name) { |
| 6132 for (var i = (0); | 6116 for (var i = (0); |
| 6133 i < this.parameters.get$length(); i++) { | 6117 i < this.parameters.get$length(); i++) { |
| 6134 var p = this.parameters.$index(i); | 6118 var p = this.parameters[i]; |
| 6135 if (p.get$isOptional() && $eq(p.get$name(), name)) { | 6119 if (p.get$isOptional() && $eq(p.get$name(), name)) { |
| 6136 return i; | 6120 return i; |
| 6137 } | 6121 } |
| 6138 } | 6122 } |
| 6139 return (-1); | 6123 return (-1); |
| 6140 } | 6124 } |
| 6141 MethodMember.prototype.provideFieldSyntax = function() { | 6125 MethodMember.prototype.provideFieldSyntax = function() { |
| 6142 this._provideFieldSyntax = true; | 6126 this._provideFieldSyntax = true; |
| 6143 } | 6127 } |
| 6144 MethodMember.prototype.providePropertySyntax = function() { | 6128 MethodMember.prototype.providePropertySyntax = function() { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6158 this._providePropertySyntax = true; | 6142 this._providePropertySyntax = true; |
| 6159 return new Value(this.get$functionType(), ("" + target.get$code() + ".get$" +
this.get$jsname() + "()"), node.span); | 6143 return new Value(this.get$functionType(), ("" + target.get$code() + ".get$" +
this.get$jsname() + "()"), node.span); |
| 6160 } | 6144 } |
| 6161 MethodMember.prototype.namesInHomePositions = function(args) { | 6145 MethodMember.prototype.namesInHomePositions = function(args) { |
| 6162 if (!args.get$hasNames()) return true; | 6146 if (!args.get$hasNames()) return true; |
| 6163 for (var i = args.get$bareCount(); | 6147 for (var i = args.get$bareCount(); |
| 6164 i < args.values.get$length(); i++) { | 6148 i < args.values.get$length(); i++) { |
| 6165 if (i >= this.parameters.get$length()) { | 6149 if (i >= this.parameters.get$length()) { |
| 6166 return false; | 6150 return false; |
| 6167 } | 6151 } |
| 6168 if (args.getName(i) != this.parameters.$index(i).get$name()) { | 6152 if (args.getName(i) != this.parameters[i].get$name()) { |
| 6169 return false; | 6153 return false; |
| 6170 } | 6154 } |
| 6171 } | 6155 } |
| 6172 return true; | 6156 return true; |
| 6173 } | 6157 } |
| 6174 MethodMember.prototype.namesInOrder = function(args) { | 6158 MethodMember.prototype.namesInOrder = function(args) { |
| 6175 if (!args.get$hasNames()) return true; | 6159 if (!args.get$hasNames()) return true; |
| 6176 var lastParameter = null; | 6160 var lastParameter = null; |
| 6177 for (var i = args.get$bareCount(); | 6161 for (var i = args.get$bareCount(); |
| 6178 i < this.parameters.get$length(); i++) { | 6162 i < this.parameters.get$length(); i++) { |
| 6179 var p = args.getIndexOfName(this.parameters.$index(i).get$name()); | 6163 var p = args.getIndexOfName(this.parameters[i].get$name()); |
| 6180 if (p >= (0) && args.values.$index(p).get$needsTemp()) { | 6164 if (p >= (0) && args.values[p].get$needsTemp()) { |
| 6181 if (lastParameter != null && lastParameter > p) { | 6165 if (lastParameter != null && lastParameter > p) { |
| 6182 return false; | 6166 return false; |
| 6183 } | 6167 } |
| 6184 lastParameter = p; | 6168 lastParameter = p; |
| 6185 } | 6169 } |
| 6186 } | 6170 } |
| 6187 return true; | 6171 return true; |
| 6188 } | 6172 } |
| 6189 MethodMember.prototype.needsArgumentConversion = function(args) { | 6173 MethodMember.prototype.needsArgumentConversion = function(args) { |
| 6190 var bareCount = args.get$bareCount(); | 6174 var bareCount = args.get$bareCount(); |
| 6191 for (var i = (0); | 6175 for (var i = (0); |
| 6192 i < bareCount; i++) { | 6176 i < bareCount; i++) { |
| 6193 var arg = args.values.$index(i); | 6177 var arg = args.values[i]; |
| 6194 if (arg.needsConversion$1(this.parameters.$index(i).get$type())) { | 6178 if (arg.needsConversion$1(this.parameters[i].get$type())) { |
| 6195 return true; | 6179 return true; |
| 6196 } | 6180 } |
| 6197 } | 6181 } |
| 6198 if (bareCount < this.parameters.get$length()) { | 6182 if (bareCount < this.parameters.get$length()) { |
| 6199 this.genParameterValues(); | 6183 this.genParameterValues(); |
| 6200 for (var i = bareCount; | 6184 for (var i = bareCount; |
| 6201 i < this.parameters.get$length(); i++) { | 6185 i < this.parameters.get$length(); i++) { |
| 6202 var arg = args.getValue(this.parameters.$index(i).get$name()); | 6186 var arg = args.getValue(this.parameters[i].get$name()); |
| 6203 if (arg != null && arg.needsConversion$1(this.parameters.$index(i).get$typ
e())) { | 6187 if (arg != null && arg.needsConversion$1(this.parameters[i].get$type())) { |
| 6204 return true; | 6188 return true; |
| 6205 } | 6189 } |
| 6206 } | 6190 } |
| 6207 } | 6191 } |
| 6208 return false; | 6192 return false; |
| 6209 } | 6193 } |
| 6210 MethodMember._argCountMsg = function(actual, expected, atLeast) { | 6194 MethodMember._argCountMsg = function(actual, expected, atLeast) { |
| 6211 return "wrong number of positional arguments, expected " + ("" + (atLeast ? "a
t least " : "") + expected + " but found " + actual); | 6195 return "wrong number of positional arguments, expected " + ("" + (atLeast ? "a
t least " : "") + expected + " but found " + actual); |
| 6212 } | 6196 } |
| 6213 MethodMember.prototype._argError = function(context, node, target, args, msg, ar
gIndex) { | 6197 MethodMember.prototype._argError = function(context, node, target, args, msg, ar
gIndex) { |
| 6214 var span; | 6198 var span; |
| 6215 if ((args.nodes == null) || (argIndex >= args.nodes.get$length())) { | 6199 if ((args.nodes == null) || (argIndex >= args.nodes.get$length())) { |
| 6216 span = node.span; | 6200 span = node.span; |
| 6217 } | 6201 } |
| 6218 else { | 6202 else { |
| 6219 span = args.nodes.$index(argIndex).get$span(); | 6203 span = args.nodes[argIndex].get$span(); |
| 6220 } | 6204 } |
| 6221 if (this.isStatic || this.get$isConstructor()) { | 6205 if (this.isStatic || this.get$isConstructor()) { |
| 6222 $globals.world.error(msg, span); | 6206 $globals.world.error(msg, span); |
| 6223 } | 6207 } |
| 6224 else { | 6208 else { |
| 6225 $globals.world.warning(msg, span); | 6209 $globals.world.warning(msg, span); |
| 6226 } | 6210 } |
| 6227 return target.invokeNoSuchMethod(context, this.name, node, args); | 6211 return target.invokeNoSuchMethod(context, this.name, node, args); |
| 6228 } | 6212 } |
| 6229 MethodMember.prototype.genParameterValues = function() { | 6213 MethodMember.prototype.genParameterValues = function() { |
| 6230 var $$list = this.parameters; | 6214 var $$list = this.parameters; |
| 6231 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6215 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6232 var p = $$list.$index($$i); | 6216 var p = $$list[$$i]; |
| 6233 p.genValue$2(this, this.generator); | 6217 p.genValue$2(this, this.generator); |
| 6234 } | 6218 } |
| 6235 } | 6219 } |
| 6236 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ | 6220 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ |
| 6237 if (this.parameters == null) { | 6221 if (this.parameters == null) { |
| 6238 $globals.world.info(("surprised to need to resolve: " + this.declaringType.n
ame + "." + this.name)); | 6222 $globals.world.info(("surprised to need to resolve: " + this.declaringType.n
ame + "." + this.name)); |
| 6239 this.resolve(); | 6223 this.resolve(); |
| 6240 } | 6224 } |
| 6241 this.declaringType.genMethod(this); | 6225 this.declaringType.genMethod(this); |
| 6242 if (this.isStatic || this.isFactory) { | 6226 if (this.isStatic || this.isFactory) { |
| 6243 this.declaringType.markUsed(); | 6227 this.declaringType.markUsed(); |
| 6244 } | 6228 } |
| 6245 if (this.get$isNative() && this.returnType != null) this.returnType.markUsed()
; | 6229 if (this.get$isNative() && this.returnType != null) this.returnType.markUsed()
; |
| 6246 if (!this.namesInOrder(args)) { | 6230 if (!this.namesInOrder(args)) { |
| 6247 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); | 6231 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); |
| 6248 } | 6232 } |
| 6249 var argsCode = []; | 6233 var argsCode = []; |
| 6250 if (!target.get$isType() && (this.get$isConstructor() || target.get$isSuper())
) { | 6234 if (!target.get$isType() && (this.get$isConstructor() || target.get$isSuper())
) { |
| 6251 argsCode.add$1("this"); | 6235 argsCode.add$1("this"); |
| 6252 } | 6236 } |
| 6253 var bareCount = args.get$bareCount(); | 6237 var bareCount = args.get$bareCount(); |
| 6254 for (var i = (0); | 6238 for (var i = (0); |
| 6255 i < bareCount; i++) { | 6239 i < bareCount; i++) { |
| 6256 var arg = args.values.$index(i); | 6240 var arg = args.values[i]; |
| 6257 if (i >= this.parameters.get$length()) { | 6241 if (i >= this.parameters.get$length()) { |
| 6258 var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.get
$length(), false); | 6242 var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.get
$length(), false); |
| 6259 return this._argError(context, node, target, args, msg, i); | 6243 return this._argError(context, node, target, args, msg, i); |
| 6260 } | 6244 } |
| 6261 arg = arg.convertTo$3(context, this.parameters.$index(i).get$type(), isDynam
ic); | 6245 arg = arg.convertTo$3(context, this.parameters[i].get$type(), isDynamic); |
| 6262 argsCode.add$1(arg.get$code()); | 6246 argsCode.add$1(arg.get$code()); |
| 6263 } | 6247 } |
| 6264 var namedArgsUsed = (0); | 6248 var namedArgsUsed = (0); |
| 6265 if (bareCount < this.parameters.get$length()) { | 6249 if (bareCount < this.parameters.get$length()) { |
| 6266 this.genParameterValues(); | 6250 this.genParameterValues(); |
| 6267 for (var i = bareCount; | 6251 for (var i = bareCount; |
| 6268 i < this.parameters.get$length(); i++) { | 6252 i < this.parameters.get$length(); i++) { |
| 6269 var arg = args.getValue(this.parameters.$index(i).get$name()); | 6253 var arg = args.getValue(this.parameters[i].get$name()); |
| 6270 if (arg == null) { | 6254 if (arg == null) { |
| 6271 arg = this.parameters.$index(i).get$value(); | 6255 arg = this.parameters[i].get$value(); |
| 6272 } | 6256 } |
| 6273 else { | 6257 else { |
| 6274 arg = arg.convertTo$3(context, this.parameters.$index(i).get$type(), isD
ynamic); | 6258 arg = arg.convertTo$3(context, this.parameters[i].get$type(), isDynamic)
; |
| 6275 namedArgsUsed++; | 6259 namedArgsUsed++; |
| 6276 } | 6260 } |
| 6277 if (arg == null || !this.parameters.$index(i).get$isOptional()) { | 6261 if (arg == null || !this.parameters[i].get$isOptional()) { |
| 6278 var msg = MethodMember._argCountMsg(Math.min(i, args.get$length()), i +
(1), true); | 6262 var msg = MethodMember._argCountMsg(Math.min(i, args.get$length()), $add
(i, (1)), true); |
| 6279 return this._argError(context, node, target, args, msg, i); | 6263 return this._argError(context, node, target, args, msg, i); |
| 6280 } | 6264 } |
| 6281 else { | 6265 else { |
| 6282 argsCode.add$1(arg.get$code()); | 6266 argsCode.add$1(arg.get$code()); |
| 6283 } | 6267 } |
| 6284 } | 6268 } |
| 6285 Arguments.removeTrailingNulls(argsCode); | 6269 Arguments.removeTrailingNulls(argsCode); |
| 6286 } | 6270 } |
| 6287 if (namedArgsUsed < args.get$nameCount()) { | 6271 if (namedArgsUsed < args.get$nameCount()) { |
| 6288 var seen = new HashSetImplementation(); | 6272 var seen = new HashSetImplementation(); |
| (...skipping 134 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); | 6407 return new Value(this.get$inferredResult(), ("" + target.get$code() + "." + th
is.get$jsname() + "(" + argsString + ")"), node.span); |
| 6424 } | 6408 } |
| 6425 MethodMember.prototype.resolve = function() { | 6409 MethodMember.prototype.resolve = function() { |
| 6426 this.isStatic = this.declaringType.get$isTop(); | 6410 this.isStatic = this.declaringType.get$isTop(); |
| 6427 this.isConst = false; | 6411 this.isConst = false; |
| 6428 this.isFactory = false; | 6412 this.isFactory = false; |
| 6429 this.isAbstract = !this.declaringType.get$isClass(); | 6413 this.isAbstract = !this.declaringType.get$isClass(); |
| 6430 if (this.definition.modifiers != null) { | 6414 if (this.definition.modifiers != null) { |
| 6431 var $$list = this.definition.modifiers; | 6415 var $$list = this.definition.modifiers; |
| 6432 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6416 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6433 var mod = $$list.$index($$i); | 6417 var mod = $$list[$$i]; |
| 6434 if ($eq(mod.get$kind(), (85))) { | 6418 if ($eq(mod.get$kind(), (85))) { |
| 6435 if (this.isStatic) { | 6419 if (this.isStatic) { |
| 6436 $globals.world.error("duplicate static modifier", mod.get$span()); | 6420 $globals.world.error("duplicate static modifier", mod.get$span()); |
| 6437 } | 6421 } |
| 6438 this.isStatic = true; | 6422 this.isStatic = true; |
| 6439 } | 6423 } |
| 6440 else if (this.get$isConstructor() && $eq(mod.get$kind(), (92))) { | 6424 else if (this.get$isConstructor() && $eq(mod.get$kind(), (92))) { |
| 6441 if (this.isConst) { | 6425 if (this.isConst) { |
| 6442 $globals.world.error("duplicate const modifier", mod.get$span()); | 6426 $globals.world.error("duplicate const modifier", mod.get$span()); |
| 6443 } | 6427 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6495 } | 6479 } |
| 6496 if (this.get$isConstructor() && !this.isFactory) { | 6480 if (this.get$isConstructor() && !this.isFactory) { |
| 6497 this.returnType = this.declaringType; | 6481 this.returnType = this.declaringType; |
| 6498 } | 6482 } |
| 6499 else { | 6483 else { |
| 6500 this.returnType = this.resolveType(this.definition.returnType, false, true); | 6484 this.returnType = this.resolveType(this.definition.returnType, false, true); |
| 6501 } | 6485 } |
| 6502 this.parameters = []; | 6486 this.parameters = []; |
| 6503 var $$list = this.definition.formals; | 6487 var $$list = this.definition.formals; |
| 6504 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6488 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6505 var formal = $$list.$index($$i); | 6489 var formal = $$list[$$i]; |
| 6506 var param = new Parameter(formal, this); | 6490 var param = new Parameter(formal, this); |
| 6507 param.resolve$0(); | 6491 param.resolve$0(); |
| 6508 this.parameters.add(param); | 6492 this.parameters.add(param); |
| 6509 } | 6493 } |
| 6510 if (!this.isLambda) { | 6494 if (!this.isLambda) { |
| 6511 this.get$library()._addMember(this); | 6495 this.get$library()._addMember(this); |
| 6512 } | 6496 } |
| 6513 } | 6497 } |
| 6514 MethodMember.prototype.resolveType = function(node, typeErrors, allowVoid) { | 6498 MethodMember.prototype.resolveType = function(node, typeErrors, allowVoid) { |
| 6515 var t = Element.prototype.resolveType.call(this, node, typeErrors); | 6499 var t = Element.prototype.resolveType.call(this, node, typeErrors); |
| 6516 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { | 6500 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { |
| 6517 $globals.world.error("using type parameter in static context.", node.span); | 6501 $globals.world.error("using type parameter in static context.", node.span); |
| 6518 } | 6502 } |
| 6519 if (!allowVoid && t.get$isVoid()) { | 6503 if (!allowVoid && t.get$isVoid()) { |
| 6520 $globals.world.error("\"void\" only allowed as return type", node.span); | 6504 $globals.world.error("\"void\" only allowed as return type", node.span); |
| 6521 } | 6505 } |
| 6522 return t; | 6506 return t; |
| 6523 } | 6507 } |
| 6524 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon
stConstructor; | 6508 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon
stConstructor; |
| 6525 MethodMember.prototype._get$3 = function($0, $1, $2) { | 6509 MethodMember.prototype._get$3 = function($0, $1, $2) { |
| 6526 return this._get($0, $1, $2, false); | 6510 return this._get($0, $1, $2, false); |
| 6527 }; | 6511 }; |
| 6528 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; | 6512 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; |
| 6529 MethodMember.prototype._get$4 = MethodMember.prototype._get; | 6513 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; | 6514 MethodMember.prototype._set$4$isDynamic = MethodMember.prototype._set; |
| 6534 MethodMember.prototype._set$5 = MethodMember.prototype._set; | 6515 MethodMember.prototype._set$5 = MethodMember.prototype._set; |
| 6535 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; | 6516 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; |
| 6536 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 6517 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6537 return this.invoke($0, $1, $2, $3, false); | 6518 return this.invoke($0, $1, $2, $3, false); |
| 6538 }; | 6519 }; |
| 6539 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; | 6520 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; |
| 6540 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; | 6521 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; |
| 6541 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; | 6522 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; |
| 6542 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; | 6523 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; |
| 6543 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; | 6524 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; |
| 6544 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; | 6525 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; |
| 6545 MethodMember.prototype.resolveType$2 = function($0, $1) { | 6526 MethodMember.prototype.resolveType$2 = function($0, $1) { |
| 6546 return this.resolveType($0, $1, false); | 6527 return this.resolveType($0, $1, false); |
| 6547 }; | 6528 }; |
| 6548 // ********** Code for MemberSet ************** | 6529 // ********** Code for MemberSet ************** |
| 6549 function MemberSet(member, isVar) { | 6530 function MemberSet(member, isVar) { |
| 6550 this.jsname = member.get$jsname(); | 6531 this.jsname = member.get$jsname(); |
| 6551 this.name = member.name; | 6532 this.name = member.name; |
| 6552 this.isVar = isVar; | 6533 this.isVar = isVar; |
| 6553 this.members = [member]; | 6534 this.members = [member]; |
| 6554 } | 6535 } |
| 6555 MemberSet.prototype.get$name = function() { return this.name; }; | 6536 MemberSet.prototype.get$name = function() { return this.name; }; |
| 6556 MemberSet.prototype.get$members = function() { return this.members; }; | 6537 MemberSet.prototype.get$members = function() { return this.members; }; |
| 6557 MemberSet.prototype.get$jsname = function() { return this.jsname; }; | 6538 MemberSet.prototype.get$jsname = function() { return this.jsname; }; |
| 6558 MemberSet.prototype.get$isVar = function() { return this.isVar; }; | 6539 MemberSet.prototype.get$isVar = function() { return this.isVar; }; |
| 6559 MemberSet.prototype.toString = function() { | 6540 MemberSet.prototype.toString = function() { |
| 6560 return ("" + this.name + ":" + this.members.get$length()); | 6541 return ("" + this.name + ":" + this.members.get$length()); |
| 6561 } | 6542 } |
| 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) { | 6543 MemberSet.prototype.add = function(member) { |
| 6569 return this.members.add(member); | 6544 return this.members.add(member); |
| 6570 } | 6545 } |
| 6571 MemberSet.prototype.get$isStatic = function() { | 6546 MemberSet.prototype.get$isStatic = function() { |
| 6572 return this.members.get$length() == (1) && this.members.$index((0)).get$isStat
ic(); | 6547 return this.members.get$length() == (1) && this.members[(0)].get$isStatic(); |
| 6573 } | 6548 } |
| 6574 MemberSet.prototype.get$isOperator = function() { | 6549 MemberSet.prototype.get$isOperator = function() { |
| 6575 return this.members.$index((0)).get$isOperator(); | 6550 return this.members[(0)].get$isOperator(); |
| 6576 } | 6551 } |
| 6577 MemberSet.prototype.canInvoke = function(context, args) { | 6552 MemberSet.prototype.canInvoke = function(context, args) { |
| 6578 return this.members.some((function (m) { | 6553 return this.members.some((function (m) { |
| 6579 return m.canInvoke$2(context, args); | 6554 return m.canInvoke$2(context, args); |
| 6580 }) | 6555 }) |
| 6581 ); | 6556 ); |
| 6582 } | 6557 } |
| 6583 MemberSet.prototype._makeError = function(node, target, action) { | 6558 MemberSet.prototype._makeError = function(node, target, action) { |
| 6584 if (!target.get$type().get$isVar()) { | 6559 if (!target.get$type().get$isVar()) { |
| 6585 $globals.world.warning(("could not find applicable " + action + " for \"" +
this.name + "\""), node.span); | 6560 $globals.world.warning(("could not find applicable " + action + " for \"" +
this.name + "\""), node.span); |
| 6586 } | 6561 } |
| 6587 return new Value($globals.world.varType, ("" + target.get$code() + "." + this.
jsname + "() /*no applicable " + action + "*/"), node.span); | 6562 return new Value($globals.world.varType, ("" + target.get$code() + "." + this.
jsname + "() /*no applicable " + action + "*/"), node.span); |
| 6588 } | 6563 } |
| 6589 MemberSet.prototype.get$treatAsField = function() { | 6564 MemberSet.prototype.get$treatAsField = function() { |
| 6590 if (this._treatAsField == null) { | 6565 if (this._treatAsField == null) { |
| 6591 this._treatAsField = !this.isVar && (this.members.some((function (m) { | 6566 this._treatAsField = !this.isVar && (this.members.some((function (m) { |
| 6592 return m.get$requiresFieldSyntax(); | 6567 return m.get$requiresFieldSyntax(); |
| 6593 }) | 6568 }) |
| 6594 ) || this.members.every((function (m) { | 6569 ) || this.members.every((function (m) { |
| 6595 return !m.get$requiresPropertySyntax(); | 6570 return !m.get$requiresPropertySyntax(); |
| 6596 }) | 6571 }) |
| 6597 )); | 6572 )); |
| 6598 var $$list = this.members; | 6573 var $$list = this.members; |
| 6599 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6574 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6600 var member = $$list.$index($$i); | 6575 var member = $$list[$$i]; |
| 6601 if (this._treatAsField) { | 6576 if (this._treatAsField) { |
| 6602 member.provideFieldSyntax$0(); | 6577 member.provideFieldSyntax$0(); |
| 6603 } | 6578 } |
| 6604 else { | 6579 else { |
| 6605 member.providePropertySyntax$0(); | 6580 member.providePropertySyntax$0(); |
| 6606 } | 6581 } |
| 6607 } | 6582 } |
| 6608 } | 6583 } |
| 6609 return this._treatAsField; | 6584 return this._treatAsField; |
| 6610 } | 6585 } |
| 6611 MemberSet.prototype._get = function(context, node, target, isDynamic) { | 6586 MemberSet.prototype._get = function(context, node, target, isDynamic) { |
| 6612 var returnValue; | 6587 var returnValue; |
| 6588 if (this.members.get$length() == (1) && !this.isVar) { |
| 6589 return this.members[(0)]._get$4(context, node, target, isDynamic); |
| 6590 } |
| 6613 var targets = this.members.filter$1((function (m) { | 6591 var targets = this.members.filter$1((function (m) { |
| 6614 return m.get$canGet(); | 6592 return m.get$canGet(); |
| 6615 }) | 6593 }) |
| 6616 ); | 6594 ); |
| 6617 if (this.isVar) { | 6595 if (this.isVar) { |
| 6618 targets.forEach$1((function (m) { | 6596 targets.forEach$1((function (m) { |
| 6619 return m._get$3$isDynamic(context, node, target, true); | 6597 return m._get$3$isDynamic(context, node, target, true); |
| 6620 }) | 6598 }) |
| 6621 ); | 6599 ); |
| 6622 returnValue = new Value(this._foldTypes(targets), null, node.span); | 6600 returnValue = new Value(this._foldTypes(targets), null, node.span); |
| 6623 } | 6601 } |
| 6624 else { | 6602 else { |
| 6625 if (this.members.get$length() == (1)) { | 6603 if (this.members.get$length() == (1)) { |
| 6626 return this.members.$index((0))._get$4(context, node, target, isDynamic); | 6604 return this.members[(0)]._get$4(context, node, target, isDynamic); |
| 6627 } | 6605 } |
| 6628 else if ($eq(targets.get$length(), (1))) { | 6606 else if ($eq(targets.get$length(), (1))) { |
| 6629 return targets.$index((0))._get$4(context, node, target, isDynamic); | 6607 return targets.$index((0))._get$4(context, node, target, isDynamic); |
| 6630 } | 6608 } |
| 6631 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6609 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6632 var member = $$i.next$0(); | 6610 var member = $$i.next$0(); |
| 6633 var value = member._get$3$isDynamic(context, node, target, true); | 6611 var value = member._get$3$isDynamic(context, node, target, true); |
| 6634 returnValue = this._tryUnion(returnValue, value, node); | 6612 returnValue = this._tryUnion(returnValue, value, node); |
| 6635 } | 6613 } |
| 6636 if (returnValue == null) { | 6614 if (returnValue == null) { |
| 6637 return this._makeError(node, target, "getter"); | 6615 return this._makeError(node, target, "getter"); |
| 6638 } | 6616 } |
| 6639 } | 6617 } |
| 6640 if (returnValue.get$code() == null) { | 6618 if (returnValue.get$code() == null) { |
| 6641 if (this.get$treatAsField()) { | 6619 if (this.get$treatAsField()) { |
| 6642 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname), node.span); | 6620 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname), node.span); |
| 6643 } | 6621 } |
| 6644 else { | 6622 else { |
| 6645 return new Value(returnValue.get$type(), ("" + target.get$code() + ".get$"
+ this.jsname + "()"), node.span); | 6623 return new Value(returnValue.get$type(), ("" + target.get$code() + ".get$"
+ this.jsname + "()"), node.span); |
| 6646 } | 6624 } |
| 6647 } | 6625 } |
| 6648 return returnValue; | 6626 return returnValue; |
| 6649 } | 6627 } |
| 6650 MemberSet.prototype._set = function(context, node, target, value, isDynamic) { | 6628 MemberSet.prototype._set = function(context, node, target, value, isDynamic) { |
| 6629 if (this.members.get$length() == (1) && !this.isVar) { |
| 6630 return this.members[(0)]._set$5(context, node, target, value, isDynamic); |
| 6631 } |
| 6651 var returnValue; | 6632 var returnValue; |
| 6652 var targets = this.members.filter$1((function (m) { | 6633 var targets = this.members.filter$1((function (m) { |
| 6653 return m.get$canSet(); | 6634 return m.get$canSet(); |
| 6654 }) | 6635 }) |
| 6655 ); | 6636 ); |
| 6656 if (this.isVar) { | 6637 if (this.isVar) { |
| 6657 targets.forEach$1((function (m) { | 6638 targets.forEach$1((function (m) { |
| 6658 return m._set$4$isDynamic(context, node, target, value, true); | 6639 return m._set$4$isDynamic(context, node, target, value, true); |
| 6659 }) | 6640 }) |
| 6660 ); | 6641 ); |
| 6661 returnValue = new Value(this._foldTypes(targets), null, node.span); | 6642 returnValue = new Value(this._foldTypes(targets), null, node.span); |
| 6662 } | 6643 } |
| 6663 else { | 6644 else { |
| 6664 if (this.members.get$length() == (1)) { | 6645 if (this.members.get$length() == (1)) { |
| 6665 return this.members.$index((0))._set$5(context, node, target, value, isDyn
amic); | 6646 return this.members[(0)]._set$5(context, node, target, value, isDynamic); |
| 6666 } | 6647 } |
| 6667 else if ($eq(targets.get$length(), (1))) { | 6648 else if ($eq(targets.get$length(), (1))) { |
| 6668 return targets.$index((0))._set$5(context, node, target, value, isDynamic)
; | 6649 return targets.$index((0))._set$5(context, node, target, value, isDynamic)
; |
| 6669 } | 6650 } |
| 6670 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6651 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6671 var member = $$i.next$0(); | 6652 var member = $$i.next$0(); |
| 6672 var res = member._set$4$isDynamic(context, node, target, value, true); | 6653 var res = member._set$4$isDynamic(context, node, target, value, true); |
| 6673 returnValue = this._tryUnion(returnValue, res, node); | 6654 returnValue = this._tryUnion(returnValue, res, node); |
| 6674 } | 6655 } |
| 6675 if (returnValue == null) { | 6656 if (returnValue == null) { |
| 6676 return this._makeError(node, target, "setter"); | 6657 return this._makeError(node, target, "setter"); |
| 6677 } | 6658 } |
| 6678 } | 6659 } |
| 6679 if (returnValue.get$code() == null) { | 6660 if (returnValue.get$code() == null) { |
| 6680 if (this.get$treatAsField()) { | 6661 if (this.get$treatAsField()) { |
| 6681 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname + " = " + value.get$code()), node.span); | 6662 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname + " = " + value.get$code()), node.span); |
| 6682 } | 6663 } |
| 6683 else { | 6664 else { |
| 6684 return new Value(returnValue.get$type(), ("" + target.get$code() + ".set$"
+ this.jsname + "(" + value.get$code() + ")"), node.span); | 6665 return new Value(returnValue.get$type(), ("" + target.get$code() + ".set$"
+ this.jsname + "(" + value.get$code() + ")"), node.span); |
| 6685 } | 6666 } |
| 6686 } | 6667 } |
| 6687 return returnValue; | 6668 return returnValue; |
| 6688 } | 6669 } |
| 6689 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { | 6670 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 6690 if (this.isVar && !this.get$isOperator()) { | 6671 if (this.isVar && !this.get$isOperator()) { |
| 6691 return this.invokeOnVar(context, node, target, args); | 6672 return this.invokeOnVar(context, node, target, args); |
| 6692 } | 6673 } |
| 6693 if (this.members.get$length() == (1)) { | 6674 if (this.members.get$length() == (1) && !this.isVar) { |
| 6694 return this.members.$index((0)).invoke$5(context, node, target, args, isDyna
mic); | 6675 return this.members[(0)].invoke$5(context, node, target, args, isDynamic); |
| 6695 } | 6676 } |
| 6696 var targets = this.members.filter$1((function (m) { | 6677 var targets = this.members.filter$1((function (m) { |
| 6697 return m.canInvoke$2(context, args); | 6678 return m.canInvoke$2(context, args); |
| 6698 }) | 6679 }) |
| 6699 ); | 6680 ); |
| 6700 if ($eq(targets.get$length(), (1))) { | 6681 if ($eq(targets.get$length(), (1))) { |
| 6701 return targets.$index((0)).invoke$5(context, node, target, args, isDynamic); | 6682 return targets.$index((0)).invoke$5(context, node, target, args, isDynamic); |
| 6702 } | 6683 } |
| 6703 var returnValue = null; | 6684 var returnValue = null; |
| 6704 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6685 if (targets.get$length() < (1000)) { |
| 6705 var member = $$i.next$0(); | 6686 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6706 var res = member.invoke$4$isDynamic(context, node, target, args, true); | 6687 var member = $$i.next$0(); |
| 6707 returnValue = this._tryUnion(returnValue, res, node); | 6688 var res = member.invoke$4$isDynamic(context, node, target, args, true); |
| 6689 returnValue = this._tryUnion(returnValue, res, node); |
| 6690 } |
| 6691 if (returnValue == null) { |
| 6692 return this._makeError(node, target, "method"); |
| 6693 } |
| 6708 } | 6694 } |
| 6709 if (returnValue == null) { | 6695 else { |
| 6710 return this._makeError(node, target, "method"); | 6696 returnValue = new Value($globals.world.varType, null, node.span); |
| 6711 } | 6697 } |
| 6712 if (returnValue.get$code() == null) { | 6698 if (returnValue.get$code() == null) { |
| 6713 if (this.name == ":call") { | 6699 if (this.name == ":call") { |
| 6714 return target._varCall(context, node, args); | 6700 return target._varCall(context, node, args); |
| 6715 } | 6701 } |
| 6716 else if (this.get$isOperator()) { | 6702 else if (this.get$isOperator()) { |
| 6717 return this.invokeSpecial(target, args, returnValue.get$type()); | 6703 return this.invokeSpecial(target, args, returnValue.get$type()); |
| 6718 } | 6704 } |
| 6719 else { | 6705 else { |
| 6720 return this.invokeOnVar(context, node, target, args); | 6706 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) { | 6763 return reduce(map(targets, (function (t) { |
| 6778 return t.get$returnType(); | 6764 return t.get$returnType(); |
| 6779 }) | 6765 }) |
| 6780 ), Type.union, $globals.world.varType); | 6766 ), Type.union, $globals.world.varType); |
| 6781 } | 6767 } |
| 6782 MemberSet.prototype._get$3 = function($0, $1, $2) { | 6768 MemberSet.prototype._get$3 = function($0, $1, $2) { |
| 6783 return this._get($0, $1, $2, false); | 6769 return this._get($0, $1, $2, false); |
| 6784 }; | 6770 }; |
| 6785 MemberSet.prototype._get$3$isDynamic = MemberSet.prototype._get; | 6771 MemberSet.prototype._get$3$isDynamic = MemberSet.prototype._get; |
| 6786 MemberSet.prototype._get$4 = MemberSet.prototype._get; | 6772 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; | 6773 MemberSet.prototype._set$4$isDynamic = MemberSet.prototype._set; |
| 6791 MemberSet.prototype._set$5 = MemberSet.prototype._set; | 6774 MemberSet.prototype._set$5 = MemberSet.prototype._set; |
| 6792 MemberSet.prototype.add$1 = MemberSet.prototype.add; | 6775 MemberSet.prototype.add$1 = MemberSet.prototype.add; |
| 6793 MemberSet.prototype.canInvoke$2 = MemberSet.prototype.canInvoke; | 6776 MemberSet.prototype.canInvoke$2 = MemberSet.prototype.canInvoke; |
| 6794 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { | 6777 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6795 return this.invoke($0, $1, $2, $3, false); | 6778 return this.invoke($0, $1, $2, $3, false); |
| 6796 }; | 6779 }; |
| 6797 MemberSet.prototype.invoke$4$isDynamic = MemberSet.prototype.invoke; | 6780 MemberSet.prototype.invoke$4$isDynamic = MemberSet.prototype.invoke; |
| 6798 MemberSet.prototype.invoke$5 = MemberSet.prototype.invoke; | 6781 MemberSet.prototype.invoke$5 = MemberSet.prototype.invoke; |
| 6799 MemberSet.prototype.toString$0 = MemberSet.prototype.toString; | 6782 MemberSet.prototype.toString$0 = MemberSet.prototype.toString; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6811 } | 6794 } |
| 6812 FactoryMap.prototype.addFactory = function(typeName, name, member) { | 6795 FactoryMap.prototype.addFactory = function(typeName, name, member) { |
| 6813 this.getFactoriesFor(typeName).$setindex(name, member); | 6796 this.getFactoriesFor(typeName).$setindex(name, member); |
| 6814 } | 6797 } |
| 6815 FactoryMap.prototype.getFactory = function(typeName, name) { | 6798 FactoryMap.prototype.getFactory = function(typeName, name) { |
| 6816 return this.getFactoriesFor(typeName).$index(name); | 6799 return this.getFactoriesFor(typeName).$index(name); |
| 6817 } | 6800 } |
| 6818 FactoryMap.prototype.forEach = function(f) { | 6801 FactoryMap.prototype.forEach = function(f) { |
| 6819 this.factories.forEach((function (_, constructors) { | 6802 this.factories.forEach((function (_, constructors) { |
| 6820 constructors.forEach((function (_, member) { | 6803 constructors.forEach((function (_, member) { |
| 6821 f(member); | 6804 f.call$1(member); |
| 6822 }) | 6805 }) |
| 6823 ); | 6806 ); |
| 6824 }) | 6807 }) |
| 6825 ); | 6808 ); |
| 6826 } | 6809 } |
| 6827 FactoryMap.prototype.forEach$1 = function($0) { | 6810 FactoryMap.prototype.forEach$1 = function($0) { |
| 6828 return this.forEach(to$call$1($0)); | 6811 return this.forEach(to$call$1($0)); |
| 6829 }; | 6812 }; |
| 6830 FactoryMap.prototype.getFactory$2 = FactoryMap.prototype.getFactory; | 6813 FactoryMap.prototype.getFactory$2 = FactoryMap.prototype.getFactory; |
| 6831 // ********** Code for Token ************** | 6814 // ********** Code for Token ************** |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6889 SourceFile.prototype.get$orderInLibrary = function() { return this.orderInLibrar
y; }; | 6872 SourceFile.prototype.get$orderInLibrary = function() { return this.orderInLibrar
y; }; |
| 6890 SourceFile.prototype.set$orderInLibrary = function(value) { return this.orderInL
ibrary = value; }; | 6873 SourceFile.prototype.set$orderInLibrary = function(value) { return this.orderInL
ibrary = value; }; |
| 6891 SourceFile.prototype.get$text = function() { | 6874 SourceFile.prototype.get$text = function() { |
| 6892 return this._text; | 6875 return this._text; |
| 6893 } | 6876 } |
| 6894 SourceFile.prototype.get$lineStarts = function() { | 6877 SourceFile.prototype.get$lineStarts = function() { |
| 6895 if (this._lineStarts == null) { | 6878 if (this._lineStarts == null) { |
| 6896 var starts = [(0)]; | 6879 var starts = [(0)]; |
| 6897 var index = (0); | 6880 var index = (0); |
| 6898 while (index < this.get$text().length) { | 6881 while (index < this.get$text().length) { |
| 6899 index = this.get$text().indexOf("\n", index) + (1); | 6882 index = $add(this.get$text().indexOf("\n", index), (1)); |
| 6900 if (index <= (0)) break; | 6883 if (index <= (0)) break; |
| 6901 starts.add$1(index); | 6884 starts.add$1(index); |
| 6902 } | 6885 } |
| 6903 starts.add$1(this.get$text().length + (1)); | 6886 starts.add$1($add(this.get$text().length, (1))); |
| 6904 this._lineStarts = starts; | 6887 this._lineStarts = starts; |
| 6905 } | 6888 } |
| 6906 return this._lineStarts; | 6889 return this._lineStarts; |
| 6907 } | 6890 } |
| 6908 SourceFile.prototype.getLine = function(position) { | 6891 SourceFile.prototype.getLine = function(position) { |
| 6909 var starts = this.get$lineStarts(); | 6892 var starts = this.get$lineStarts(); |
| 6910 for (var i = (0); | 6893 for (var i = (0); |
| 6911 i < starts.get$length(); i++) { | 6894 i < starts.get$length(); i++) { |
| 6912 if (starts.$index(i) > position) return i - (1); | 6895 if (starts.$index(i) > position) return i - (1); |
| 6913 } | 6896 } |
| 6914 $globals.world.internalError("bad position"); | 6897 $globals.world.internalError("bad position"); |
| 6915 } | 6898 } |
| 6916 SourceFile.prototype.getColumn = function(line, position) { | 6899 SourceFile.prototype.getColumn = function(line, position) { |
| 6917 return position - this.get$lineStarts().$index(line); | 6900 return position - this.get$lineStarts()[line]; |
| 6918 } | 6901 } |
| 6919 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { | 6902 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { |
| 6920 var line = this.getLine(start); | 6903 var line = this.getLine(start); |
| 6921 var column = this.getColumn(line, start); | 6904 var column = this.getColumn(line, start); |
| 6922 var buf = new StringBufferImpl(("" + this.filename + ":" + ($add(line, (1))) +
":" + ($add(column, (1))) + ": " + message)); | 6905 var buf = new StringBufferImpl(("" + this.filename + ":" + ($add(line, (1))) +
":" + ($add(column, (1))) + ": " + message)); |
| 6923 if (includeText) { | 6906 if (includeText) { |
| 6924 buf.add$1("\n"); | 6907 buf.add$1("\n"); |
| 6925 var textLine; | 6908 var textLine; |
| 6926 if (($add(line, (2))) < this._lineStarts.get$length()) { | 6909 if (($add(line, (2))) < this._lineStarts.get$length()) { |
| 6927 textLine = this.get$text().substring(this._lineStarts.$index(line), this._
lineStarts.$index($add(line, (1)))); | 6910 textLine = this.get$text().substring(this._lineStarts[line], this._lineSta
rts[$add(line, (1))]); |
| 6928 } | 6911 } |
| 6929 else { | 6912 else { |
| 6930 textLine = this.get$text().substring(this._lineStarts.$index(line)) + "\n"
; | 6913 textLine = this.get$text().substring(this._lineStarts[line]) + "\n"; |
| 6931 } | 6914 } |
| 6932 var toColumn = Math.min($add(column, (end - start)), textLine.get$length()); | 6915 var toColumn = Math.min($add(column, (end - start)), textLine.get$length()); |
| 6933 if ($globals.options.useColors) { | 6916 if ($globals.options.useColors) { |
| 6934 buf.add$1(textLine.substring$2((0), column)); | 6917 buf.add$1(textLine.substring$2((0), column)); |
| 6935 buf.add$1($globals._RED_COLOR); | 6918 buf.add$1($globals._RED_COLOR); |
| 6936 buf.add$1(textLine.substring$2(column, toColumn)); | 6919 buf.add$1(textLine.substring$2(column, toColumn)); |
| 6937 buf.add$1($globals._NO_COLOR); | 6920 buf.add$1($globals._NO_COLOR); |
| 6938 buf.add$1(textLine.substring$1(toColumn)); | 6921 buf.add$1(textLine.substring$1(toColumn)); |
| 6939 } | 6922 } |
| 6940 else { | 6923 else { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7175 else { | 7158 else { |
| 7176 return (-1); | 7159 return (-1); |
| 7177 } | 7160 } |
| 7178 } | 7161 } |
| 7179 TokenizerBase.prototype.readHex = function(hexLength) { | 7162 TokenizerBase.prototype.readHex = function(hexLength) { |
| 7180 var maxIndex; | 7163 var maxIndex; |
| 7181 if (hexLength == null) { | 7164 if (hexLength == null) { |
| 7182 maxIndex = this._text.length - (1); | 7165 maxIndex = this._text.length - (1); |
| 7183 } | 7166 } |
| 7184 else { | 7167 else { |
| 7185 maxIndex = this._lang_index + hexLength; | 7168 maxIndex = $add(this._lang_index, hexLength); |
| 7186 if (maxIndex >= this._text.length) return (-1); | 7169 if (maxIndex >= this._text.length) return (-1); |
| 7187 } | 7170 } |
| 7188 var result = (0); | 7171 var result = (0); |
| 7189 while (this._lang_index < maxIndex) { | 7172 while (this._lang_index < maxIndex) { |
| 7190 var digit = TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index))
; | 7173 var digit = TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index))
; |
| 7191 if ($eq(digit, (-1))) { | 7174 if ($eq(digit, (-1))) { |
| 7192 if (hexLength == null) { | 7175 if (hexLength == null) { |
| 7193 return result; | 7176 return result; |
| 7194 } | 7177 } |
| 7195 else { | 7178 else { |
| 7196 return (-1); | 7179 return (-1); |
| 7197 } | 7180 } |
| 7198 } | 7181 } |
| 7199 TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index)); | 7182 TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index)); |
| 7200 result = (result * (16)) + digit; | 7183 result = $add((result * (16)), digit); |
| 7201 this._lang_index++; | 7184 this._lang_index++; |
| 7202 } | 7185 } |
| 7203 return result; | 7186 return result; |
| 7204 } | 7187 } |
| 7205 TokenizerBase.prototype.finishHex = function() { | 7188 TokenizerBase.prototype.finishHex = function() { |
| 7206 var value = this.readHex(); | 7189 var value = this.readHex(); |
| 7207 return new LiteralToken((61), this._source, this._startIndex, this._lang_index
, value); | 7190 return new LiteralToken((61), this._source, this._startIndex, this._lang_index
, value); |
| 7208 } | 7191 } |
| 7209 TokenizerBase.prototype.finishNumber = function() { | 7192 TokenizerBase.prototype.finishNumber = function() { |
| 7210 this.eatDigits(); | 7193 this.eatDigits(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 7234 return this._finishToken(kind); | 7217 return this._finishToken(kind); |
| 7235 } | 7218 } |
| 7236 TokenizerBase.prototype._makeStringToken = function(buf, isPart) { | 7219 TokenizerBase.prototype._makeStringToken = function(buf, isPart) { |
| 7237 var s = Strings.String$fromCharCodes$factory(buf); | 7220 var s = Strings.String$fromCharCodes$factory(buf); |
| 7238 var kind = isPart ? (59) : (58); | 7221 var kind = isPart ? (59) : (58); |
| 7239 return new LiteralToken(kind, this._source, this._startIndex, this._lang_index
, s); | 7222 return new LiteralToken(kind, this._source, this._startIndex, this._lang_index
, s); |
| 7240 } | 7223 } |
| 7241 TokenizerBase.prototype._makeRawStringToken = function(isMultiline) { | 7224 TokenizerBase.prototype._makeRawStringToken = function(isMultiline) { |
| 7242 var s; | 7225 var s; |
| 7243 if (isMultiline) { | 7226 if (isMultiline) { |
| 7244 var start = this._startIndex + (4); | 7227 var start = $add(this._startIndex, (4)); |
| 7245 if (this._source.get$text()[start] == "\n") start++; | 7228 if (this._source.get$text()[start] == "\n") start++; |
| 7246 s = this._source.get$text().substring(start, this._lang_index - (3)); | 7229 s = this._source.get$text().substring(start, this._lang_index - (3)); |
| 7247 } | 7230 } |
| 7248 else { | 7231 else { |
| 7249 s = this._source.get$text().substring(this._startIndex + (2), this._lang_ind
ex - (1)); | 7232 s = this._source.get$text().substring($add(this._startIndex, (2)), this._lan
g_index - (1)); |
| 7250 } | 7233 } |
| 7251 return new LiteralToken((58), this._source, this._startIndex, this._lang_index
, s); | 7234 return new LiteralToken((58), this._source, this._startIndex, this._lang_index
, s); |
| 7252 } | 7235 } |
| 7253 TokenizerBase.prototype.finishMultilineString = function(quote) { | 7236 TokenizerBase.prototype.finishMultilineString = function(quote) { |
| 7254 var buf = []; | 7237 var buf = []; |
| 7255 while (true) { | 7238 while (true) { |
| 7256 var ch = this._nextChar(); | 7239 var ch = this._nextChar(); |
| 7257 if (ch == (0)) { | 7240 if (ch == (0)) { |
| 7258 return this._errorToken(); | 7241 return this._errorToken(); |
| 7259 } | 7242 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 7284 } | 7267 } |
| 7285 } | 7268 } |
| 7286 } | 7269 } |
| 7287 TokenizerBase.prototype._finishOpenBrace = function() { | 7270 TokenizerBase.prototype._finishOpenBrace = function() { |
| 7288 var $0; | 7271 var $0; |
| 7289 if (this._interpStack != null) { | 7272 if (this._interpStack != null) { |
| 7290 if (this._interpStack.depth == (-1)) { | 7273 if (this._interpStack.depth == (-1)) { |
| 7291 this._interpStack.depth = (1); | 7274 this._interpStack.depth = (1); |
| 7292 } | 7275 } |
| 7293 else { | 7276 else { |
| 7294 ($0 = this._interpStack).depth = $0.depth + (1); | 7277 ($0 = this._interpStack).depth = $add($0.depth, (1)); |
| 7295 } | 7278 } |
| 7296 } | 7279 } |
| 7297 return this._finishToken((6)); | 7280 return this._finishToken((6)); |
| 7298 } | 7281 } |
| 7299 TokenizerBase.prototype._finishCloseBrace = function() { | 7282 TokenizerBase.prototype._finishCloseBrace = function() { |
| 7300 var $0; | 7283 var $0; |
| 7301 if (this._interpStack != null) { | 7284 if (this._interpStack != null) { |
| 7302 ($0 = this._interpStack).depth = $0.depth - (1); | 7285 ($0 = this._interpStack).depth = $0.depth - (1); |
| 7303 } | 7286 } |
| 7304 return this._finishToken((7)); | 7287 return this._finishToken((7)); |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8495 case (115): | 8478 case (115): |
| 8496 | 8479 |
| 8497 return "keyword 'void'"; | 8480 return "keyword 'void'"; |
| 8498 | 8481 |
| 8499 case (116): | 8482 case (116): |
| 8500 | 8483 |
| 8501 return "keyword 'while'"; | 8484 return "keyword 'while'"; |
| 8502 | 8485 |
| 8503 default: | 8486 default: |
| 8504 | 8487 |
| 8505 return "TokenKind(" + kind.toString() + ")"; | 8488 return "TokenKind(" + kind.toString$0() + ")"; |
| 8506 | 8489 |
| 8507 } | 8490 } |
| 8508 } | 8491 } |
| 8509 TokenKind.isIdentifier = function(kind) { | 8492 TokenKind.isIdentifier = function(kind) { |
| 8510 return kind >= (70) && kind < (87); | 8493 return kind >= (70) && kind < (87); |
| 8511 } | 8494 } |
| 8512 TokenKind.infixPrecedence = function(kind) { | 8495 TokenKind.infixPrecedence = function(kind) { |
| 8513 switch (kind) { | 8496 switch (kind) { |
| 8514 case (20): | 8497 case (20): |
| 8515 | 8498 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8833 | 8816 |
| 8834 case (57): | 8817 case (57): |
| 8835 | 8818 |
| 8836 return ":setindex"; | 8819 return ":setindex"; |
| 8837 | 8820 |
| 8838 } | 8821 } |
| 8839 } | 8822 } |
| 8840 TokenKind.kindFromAssign = function(kind) { | 8823 TokenKind.kindFromAssign = function(kind) { |
| 8841 if (kind == (20)) return (0); | 8824 if (kind == (20)) return (0); |
| 8842 if (kind > (20) && kind <= (32)) { | 8825 if (kind > (20) && kind <= (32)) { |
| 8843 return kind + (15); | 8826 return $add(kind, (15)); |
| 8844 } | 8827 } |
| 8845 return (-1); | 8828 return (-1); |
| 8846 } | 8829 } |
| 8847 // ********** Code for Parser ************** | 8830 // ********** Code for Parser ************** |
| 8848 function Parser(source, diet, throwOnIncomplete, optionalSemicolons, startOffset
) { | 8831 function Parser(source, diet, throwOnIncomplete, optionalSemicolons, startOffset
) { |
| 8849 this.throwOnIncomplete = throwOnIncomplete; | 8832 this.throwOnIncomplete = throwOnIncomplete; |
| 8850 this.source = source; | 8833 this.source = source; |
| 8851 this.optionalSemicolons = optionalSemicolons; | 8834 this.optionalSemicolons = optionalSemicolons; |
| 8852 this._recover = false; | 8835 this._recover = false; |
| 8853 this._inhibitLambda = false; | 8836 this._inhibitLambda = false; |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9904 if (this._inhibitLambda) return false; | 9887 if (this._inhibitLambda) return false; |
| 9905 var after = this._peekAfterCloseParen(); | 9888 var after = this._peekAfterCloseParen(); |
| 9906 return after.kind == (9) || after.kind == (6); | 9889 return after.kind == (9) || after.kind == (6); |
| 9907 } | 9890 } |
| 9908 Parser.prototype._eatLeftParen = function() { | 9891 Parser.prototype._eatLeftParen = function() { |
| 9909 this._eat((2)); | 9892 this._eat((2)); |
| 9910 this._afterParensIndex++; | 9893 this._afterParensIndex++; |
| 9911 } | 9894 } |
| 9912 Parser.prototype._peekAfterCloseParen = function() { | 9895 Parser.prototype._peekAfterCloseParen = function() { |
| 9913 if (this._afterParensIndex < this._afterParens.get$length()) { | 9896 if (this._afterParensIndex < this._afterParens.get$length()) { |
| 9914 return this._afterParens.$index(this._afterParensIndex); | 9897 return this._afterParens[this._afterParensIndex]; |
| 9915 } | 9898 } |
| 9916 this._afterParensIndex = (0); | 9899 this._afterParensIndex = (0); |
| 9917 this._afterParens.clear(); | 9900 this._afterParens.clear(); |
| 9918 var tokens = [this._lang_next()]; | 9901 var tokens = [this._lang_next()]; |
| 9919 this._lookaheadAfterParens(tokens); | 9902 this._lookaheadAfterParens(tokens); |
| 9920 var after = this._peekToken; | 9903 var after = this._peekToken; |
| 9921 tokens.add$1(after); | 9904 tokens.add$1(after); |
| 9922 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); | 9905 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); |
| 9923 this._lang_next(); | 9906 this._lang_next(); |
| 9924 return after; | 9907 return after; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10174 return depth; | 10157 return depth; |
| 10175 } | 10158 } |
| 10176 } | 10159 } |
| 10177 Parser.prototype.addTypeArguments = function(baseType, depth) { | 10160 Parser.prototype.addTypeArguments = function(baseType, depth) { |
| 10178 this._eat((52)); | 10161 this._eat((52)); |
| 10179 return this._finishTypeArguments(baseType, depth, []); | 10162 return this._finishTypeArguments(baseType, depth, []); |
| 10180 } | 10163 } |
| 10181 Parser.prototype._finishTypeArguments = function(baseType, depth, types) { | 10164 Parser.prototype._finishTypeArguments = function(baseType, depth, types) { |
| 10182 var delta = (-1); | 10165 var delta = (-1); |
| 10183 do { | 10166 do { |
| 10184 var myType = this.type(depth + (1)); | 10167 var myType = this.type($add(depth, (1))); |
| 10185 types.add$1(myType); | 10168 types.add$1(myType); |
| 10186 if ((myType instanceof GenericTypeReference) && myType.get$depth() <= depth)
{ | 10169 if ((myType instanceof GenericTypeReference) && myType.get$depth() <= depth)
{ |
| 10187 delta = depth - myType.get$depth(); | 10170 delta = depth - myType.get$depth(); |
| 10188 break; | 10171 break; |
| 10189 } | 10172 } |
| 10190 } | 10173 } |
| 10191 while (this._maybeEat((11))) | 10174 while (this._maybeEat((11))) |
| 10192 if (delta >= (0)) { | 10175 if (delta >= (0)) { |
| 10193 depth = depth - delta; | 10176 depth = depth - delta; |
| 10194 } | 10177 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10375 } | 10358 } |
| 10376 IncompleteSourceException.prototype.toString$0 = IncompleteSourceException.proto
type.toString; | 10359 IncompleteSourceException.prototype.toString$0 = IncompleteSourceException.proto
type.toString; |
| 10377 // ********** Code for DivertedTokenSource ************** | 10360 // ********** Code for DivertedTokenSource ************** |
| 10378 function DivertedTokenSource(tokens, parser, previousTokenizer) { | 10361 function DivertedTokenSource(tokens, parser, previousTokenizer) { |
| 10379 this.parser = parser; | 10362 this.parser = parser; |
| 10380 this._lang_pos = (0); | 10363 this._lang_pos = (0); |
| 10381 this.tokens = tokens; | 10364 this.tokens = tokens; |
| 10382 this.previousTokenizer = previousTokenizer; | 10365 this.previousTokenizer = previousTokenizer; |
| 10383 } | 10366 } |
| 10384 DivertedTokenSource.prototype.next = function() { | 10367 DivertedTokenSource.prototype.next = function() { |
| 10385 var token = this.tokens.$index(this._lang_pos); | 10368 var token = this.tokens[this._lang_pos]; |
| 10386 ++this._lang_pos; | 10369 ++this._lang_pos; |
| 10387 if (this._lang_pos == this.tokens.get$length()) { | 10370 if (this._lang_pos == this.tokens.get$length()) { |
| 10388 this.parser.tokenizer = this.previousTokenizer; | 10371 this.parser.tokenizer = this.previousTokenizer; |
| 10389 } | 10372 } |
| 10390 return token; | 10373 return token; |
| 10391 } | 10374 } |
| 10392 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next; | 10375 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next; |
| 10393 // ********** Code for Node ************** | 10376 // ********** Code for Node ************** |
| 10394 function Node(span) { | 10377 function Node(span) { |
| 10395 this.span = span; | 10378 this.span = span; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10495 this.type = type; | 10478 this.type = type; |
| 10496 this.names = names; | 10479 this.names = names; |
| 10497 this.values = values; | 10480 this.values = values; |
| 10498 Definition.call(this, span); | 10481 Definition.call(this, span); |
| 10499 } | 10482 } |
| 10500 VariableDefinition.prototype.get$type = function() { return this.type; }; | 10483 VariableDefinition.prototype.get$type = function() { return this.type; }; |
| 10501 VariableDefinition.prototype.set$type = function(value) { return this.type = val
ue; }; | 10484 VariableDefinition.prototype.set$type = function(value) { return this.type = val
ue; }; |
| 10502 VariableDefinition.prototype.get$names = function() { return this.names; }; | 10485 VariableDefinition.prototype.get$names = function() { return this.names; }; |
| 10503 VariableDefinition.prototype.set$names = function(value) { return this.names = v
alue; }; | 10486 VariableDefinition.prototype.set$names = function(value) { return this.names = v
alue; }; |
| 10504 VariableDefinition.prototype.visit = function(visitor) { | 10487 VariableDefinition.prototype.visit = function(visitor) { |
| 10505 return visitor.visitVariableDefinition(this); | 10488 return visitor.visitVariableDefinition$1(this); |
| 10506 } | 10489 } |
| 10507 VariableDefinition.prototype.visit$1 = VariableDefinition.prototype.visit; | 10490 VariableDefinition.prototype.visit$1 = VariableDefinition.prototype.visit; |
| 10508 // ********** Code for FunctionDefinition ************** | 10491 // ********** Code for FunctionDefinition ************** |
| 10509 $inherits(FunctionDefinition, Definition); | 10492 $inherits(FunctionDefinition, Definition); |
| 10510 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
nativeBody, body, span) { | 10493 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
nativeBody, body, span) { |
| 10511 this.modifiers = modifiers; | 10494 this.modifiers = modifiers; |
| 10512 this.name = name; | 10495 this.name = name; |
| 10513 this.initializers = initializers; | 10496 this.initializers = initializers; |
| 10514 this.body = body; | 10497 this.body = body; |
| 10515 this.returnType = returnType; | 10498 this.returnType = returnType; |
| 10516 this.formals = formals; | 10499 this.formals = formals; |
| 10517 this.nativeBody = nativeBody; | 10500 this.nativeBody = nativeBody; |
| 10518 Definition.call(this, span); | 10501 Definition.call(this, span); |
| 10519 } | 10502 } |
| 10520 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; | 10503 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; |
| 10521 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; | 10504 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; |
| 10522 FunctionDefinition.prototype.get$name = function() { return this.name; }; | 10505 FunctionDefinition.prototype.get$name = function() { return this.name; }; |
| 10523 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; | 10506 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 10524 FunctionDefinition.prototype.get$initializers = function() { return this.initial
izers; }; | 10507 FunctionDefinition.prototype.get$initializers = function() { return this.initial
izers; }; |
| 10525 FunctionDefinition.prototype.set$initializers = function(value) { return this.in
itializers = value; }; | 10508 FunctionDefinition.prototype.set$initializers = function(value) { return this.in
itializers = value; }; |
| 10526 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod
y; }; | 10509 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod
y; }; |
| 10527 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati
veBody = value; }; | 10510 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati
veBody = value; }; |
| 10528 FunctionDefinition.prototype.get$body = function() { return this.body; }; | 10511 FunctionDefinition.prototype.get$body = function() { return this.body; }; |
| 10529 FunctionDefinition.prototype.set$body = function(value) { return this.body = val
ue; }; | 10512 FunctionDefinition.prototype.set$body = function(value) { return this.body = val
ue; }; |
| 10530 FunctionDefinition.prototype.visit = function(visitor) { | 10513 FunctionDefinition.prototype.visit = function(visitor) { |
| 10531 return visitor.visitFunctionDefinition(this); | 10514 return visitor.visitFunctionDefinition$1(this); |
| 10532 } | 10515 } |
| 10533 FunctionDefinition.prototype.visit$1 = FunctionDefinition.prototype.visit; | 10516 FunctionDefinition.prototype.visit$1 = FunctionDefinition.prototype.visit; |
| 10534 // ********** Code for ReturnStatement ************** | 10517 // ********** Code for ReturnStatement ************** |
| 10535 $inherits(ReturnStatement, Statement); | 10518 $inherits(ReturnStatement, Statement); |
| 10536 function ReturnStatement(value, span) { | 10519 function ReturnStatement(value, span) { |
| 10537 this.value = value; | 10520 this.value = value; |
| 10538 Statement.call(this, span); | 10521 Statement.call(this, span); |
| 10539 } | 10522 } |
| 10540 ReturnStatement.prototype.get$value = function() { return this.value; }; | 10523 ReturnStatement.prototype.get$value = function() { return this.value; }; |
| 10541 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; | 10524 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; |
| 10542 ReturnStatement.prototype.visit = function(visitor) { | 10525 ReturnStatement.prototype.visit = function(visitor) { |
| 10543 return visitor.visitReturnStatement(this); | 10526 return visitor.visitReturnStatement$1(this); |
| 10544 } | 10527 } |
| 10545 ReturnStatement.prototype.visit$1 = ReturnStatement.prototype.visit; | 10528 ReturnStatement.prototype.visit$1 = ReturnStatement.prototype.visit; |
| 10546 // ********** Code for ThrowStatement ************** | 10529 // ********** Code for ThrowStatement ************** |
| 10547 $inherits(ThrowStatement, Statement); | 10530 $inherits(ThrowStatement, Statement); |
| 10548 function ThrowStatement(value, span) { | 10531 function ThrowStatement(value, span) { |
| 10549 this.value = value; | 10532 this.value = value; |
| 10550 Statement.call(this, span); | 10533 Statement.call(this, span); |
| 10551 } | 10534 } |
| 10552 ThrowStatement.prototype.get$value = function() { return this.value; }; | 10535 ThrowStatement.prototype.get$value = function() { return this.value; }; |
| 10553 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; | 10536 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; |
| 10554 ThrowStatement.prototype.visit = function(visitor) { | 10537 ThrowStatement.prototype.visit = function(visitor) { |
| 10555 return visitor.visitThrowStatement(this); | 10538 return visitor.visitThrowStatement$1(this); |
| 10556 } | 10539 } |
| 10557 ThrowStatement.prototype.visit$1 = ThrowStatement.prototype.visit; | 10540 ThrowStatement.prototype.visit$1 = ThrowStatement.prototype.visit; |
| 10558 // ********** Code for AssertStatement ************** | 10541 // ********** Code for AssertStatement ************** |
| 10559 $inherits(AssertStatement, Statement); | 10542 $inherits(AssertStatement, Statement); |
| 10560 function AssertStatement(test, span) { | 10543 function AssertStatement(test, span) { |
| 10561 this.test = test; | 10544 this.test = test; |
| 10562 Statement.call(this, span); | 10545 Statement.call(this, span); |
| 10563 } | 10546 } |
| 10564 AssertStatement.prototype.visit = function(visitor) { | 10547 AssertStatement.prototype.visit = function(visitor) { |
| 10565 return visitor.visitAssertStatement(this); | 10548 return visitor.visitAssertStatement$1(this); |
| 10566 } | 10549 } |
| 10567 AssertStatement.prototype.visit$1 = AssertStatement.prototype.visit; | 10550 AssertStatement.prototype.visit$1 = AssertStatement.prototype.visit; |
| 10568 // ********** Code for BreakStatement ************** | 10551 // ********** Code for BreakStatement ************** |
| 10569 $inherits(BreakStatement, Statement); | 10552 $inherits(BreakStatement, Statement); |
| 10570 function BreakStatement(label, span) { | 10553 function BreakStatement(label, span) { |
| 10571 this.label = label; | 10554 this.label = label; |
| 10572 Statement.call(this, span); | 10555 Statement.call(this, span); |
| 10573 } | 10556 } |
| 10574 BreakStatement.prototype.get$label = function() { return this.label; }; | 10557 BreakStatement.prototype.get$label = function() { return this.label; }; |
| 10575 BreakStatement.prototype.set$label = function(value) { return this.label = value
; }; | 10558 BreakStatement.prototype.set$label = function(value) { return this.label = value
; }; |
| 10576 BreakStatement.prototype.visit = function(visitor) { | 10559 BreakStatement.prototype.visit = function(visitor) { |
| 10577 return visitor.visitBreakStatement(this); | 10560 return visitor.visitBreakStatement$1(this); |
| 10578 } | 10561 } |
| 10579 BreakStatement.prototype.visit$1 = BreakStatement.prototype.visit; | 10562 BreakStatement.prototype.visit$1 = BreakStatement.prototype.visit; |
| 10580 // ********** Code for ContinueStatement ************** | 10563 // ********** Code for ContinueStatement ************** |
| 10581 $inherits(ContinueStatement, Statement); | 10564 $inherits(ContinueStatement, Statement); |
| 10582 function ContinueStatement(label, span) { | 10565 function ContinueStatement(label, span) { |
| 10583 this.label = label; | 10566 this.label = label; |
| 10584 Statement.call(this, span); | 10567 Statement.call(this, span); |
| 10585 } | 10568 } |
| 10586 ContinueStatement.prototype.get$label = function() { return this.label; }; | 10569 ContinueStatement.prototype.get$label = function() { return this.label; }; |
| 10587 ContinueStatement.prototype.set$label = function(value) { return this.label = va
lue; }; | 10570 ContinueStatement.prototype.set$label = function(value) { return this.label = va
lue; }; |
| 10588 ContinueStatement.prototype.visit = function(visitor) { | 10571 ContinueStatement.prototype.visit = function(visitor) { |
| 10589 return visitor.visitContinueStatement(this); | 10572 return visitor.visitContinueStatement$1(this); |
| 10590 } | 10573 } |
| 10591 ContinueStatement.prototype.visit$1 = ContinueStatement.prototype.visit; | 10574 ContinueStatement.prototype.visit$1 = ContinueStatement.prototype.visit; |
| 10592 // ********** Code for IfStatement ************** | 10575 // ********** Code for IfStatement ************** |
| 10593 $inherits(IfStatement, Statement); | 10576 $inherits(IfStatement, Statement); |
| 10594 function IfStatement(test, trueBranch, falseBranch, span) { | 10577 function IfStatement(test, trueBranch, falseBranch, span) { |
| 10595 this.test = test; | 10578 this.test = test; |
| 10596 this.falseBranch = falseBranch; | 10579 this.falseBranch = falseBranch; |
| 10597 this.trueBranch = trueBranch; | 10580 this.trueBranch = trueBranch; |
| 10598 Statement.call(this, span); | 10581 Statement.call(this, span); |
| 10599 } | 10582 } |
| 10600 IfStatement.prototype.visit = function(visitor) { | 10583 IfStatement.prototype.visit = function(visitor) { |
| 10601 return visitor.visitIfStatement(this); | 10584 return visitor.visitIfStatement$1(this); |
| 10602 } | 10585 } |
| 10603 IfStatement.prototype.visit$1 = IfStatement.prototype.visit; | 10586 IfStatement.prototype.visit$1 = IfStatement.prototype.visit; |
| 10604 // ********** Code for WhileStatement ************** | 10587 // ********** Code for WhileStatement ************** |
| 10605 $inherits(WhileStatement, Statement); | 10588 $inherits(WhileStatement, Statement); |
| 10606 function WhileStatement(test, body, span) { | 10589 function WhileStatement(test, body, span) { |
| 10607 this.body = body; | 10590 this.body = body; |
| 10608 this.test = test; | 10591 this.test = test; |
| 10609 Statement.call(this, span); | 10592 Statement.call(this, span); |
| 10610 } | 10593 } |
| 10611 WhileStatement.prototype.get$body = function() { return this.body; }; | 10594 WhileStatement.prototype.get$body = function() { return this.body; }; |
| 10612 WhileStatement.prototype.set$body = function(value) { return this.body = value;
}; | 10595 WhileStatement.prototype.set$body = function(value) { return this.body = value;
}; |
| 10613 WhileStatement.prototype.visit = function(visitor) { | 10596 WhileStatement.prototype.visit = function(visitor) { |
| 10614 return visitor.visitWhileStatement(this); | 10597 return visitor.visitWhileStatement$1(this); |
| 10615 } | 10598 } |
| 10616 WhileStatement.prototype.visit$1 = WhileStatement.prototype.visit; | 10599 WhileStatement.prototype.visit$1 = WhileStatement.prototype.visit; |
| 10617 // ********** Code for DoStatement ************** | 10600 // ********** Code for DoStatement ************** |
| 10618 $inherits(DoStatement, Statement); | 10601 $inherits(DoStatement, Statement); |
| 10619 function DoStatement(body, test, span) { | 10602 function DoStatement(body, test, span) { |
| 10620 this.body = body; | 10603 this.body = body; |
| 10621 this.test = test; | 10604 this.test = test; |
| 10622 Statement.call(this, span); | 10605 Statement.call(this, span); |
| 10623 } | 10606 } |
| 10624 DoStatement.prototype.get$body = function() { return this.body; }; | 10607 DoStatement.prototype.get$body = function() { return this.body; }; |
| 10625 DoStatement.prototype.set$body = function(value) { return this.body = value; }; | 10608 DoStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10626 DoStatement.prototype.visit = function(visitor) { | 10609 DoStatement.prototype.visit = function(visitor) { |
| 10627 return visitor.visitDoStatement(this); | 10610 return visitor.visitDoStatement$1(this); |
| 10628 } | 10611 } |
| 10629 DoStatement.prototype.visit$1 = DoStatement.prototype.visit; | 10612 DoStatement.prototype.visit$1 = DoStatement.prototype.visit; |
| 10630 // ********** Code for ForStatement ************** | 10613 // ********** Code for ForStatement ************** |
| 10631 $inherits(ForStatement, Statement); | 10614 $inherits(ForStatement, Statement); |
| 10632 function ForStatement(init, test, step, body, span) { | 10615 function ForStatement(init, test, step, body, span) { |
| 10633 this.body = body; | 10616 this.body = body; |
| 10634 this.test = test; | 10617 this.test = test; |
| 10635 this.step = step; | 10618 this.step = step; |
| 10636 this.init = init; | 10619 this.init = init; |
| 10637 Statement.call(this, span); | 10620 Statement.call(this, span); |
| 10638 } | 10621 } |
| 10639 ForStatement.prototype.get$body = function() { return this.body; }; | 10622 ForStatement.prototype.get$body = function() { return this.body; }; |
| 10640 ForStatement.prototype.set$body = function(value) { return this.body = value; }; | 10623 ForStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10641 ForStatement.prototype.visit = function(visitor) { | 10624 ForStatement.prototype.visit = function(visitor) { |
| 10642 return visitor.visitForStatement(this); | 10625 return visitor.visitForStatement$1(this); |
| 10643 } | 10626 } |
| 10644 ForStatement.prototype.visit$1 = ForStatement.prototype.visit; | 10627 ForStatement.prototype.visit$1 = ForStatement.prototype.visit; |
| 10645 // ********** Code for ForInStatement ************** | 10628 // ********** Code for ForInStatement ************** |
| 10646 $inherits(ForInStatement, Statement); | 10629 $inherits(ForInStatement, Statement); |
| 10647 function ForInStatement(item, list, body, span) { | 10630 function ForInStatement(item, list, body, span) { |
| 10648 this.body = body; | 10631 this.body = body; |
| 10649 this.item = item; | 10632 this.item = item; |
| 10650 this.list = list; | 10633 this.list = list; |
| 10651 Statement.call(this, span); | 10634 Statement.call(this, span); |
| 10652 } | 10635 } |
| 10653 ForInStatement.prototype.get$body = function() { return this.body; }; | 10636 ForInStatement.prototype.get$body = function() { return this.body; }; |
| 10654 ForInStatement.prototype.set$body = function(value) { return this.body = value;
}; | 10637 ForInStatement.prototype.set$body = function(value) { return this.body = value;
}; |
| 10655 ForInStatement.prototype.visit = function(visitor) { | 10638 ForInStatement.prototype.visit = function(visitor) { |
| 10656 return visitor.visitForInStatement(this); | 10639 return visitor.visitForInStatement$1(this); |
| 10657 } | 10640 } |
| 10658 ForInStatement.prototype.visit$1 = ForInStatement.prototype.visit; | 10641 ForInStatement.prototype.visit$1 = ForInStatement.prototype.visit; |
| 10659 // ********** Code for TryStatement ************** | 10642 // ********** Code for TryStatement ************** |
| 10660 $inherits(TryStatement, Statement); | 10643 $inherits(TryStatement, Statement); |
| 10661 function TryStatement(body, catches, finallyBlock, span) { | 10644 function TryStatement(body, catches, finallyBlock, span) { |
| 10662 this.body = body; | 10645 this.body = body; |
| 10663 this.finallyBlock = finallyBlock; | 10646 this.finallyBlock = finallyBlock; |
| 10664 this.catches = catches; | 10647 this.catches = catches; |
| 10665 Statement.call(this, span); | 10648 Statement.call(this, span); |
| 10666 } | 10649 } |
| 10667 TryStatement.prototype.get$body = function() { return this.body; }; | 10650 TryStatement.prototype.get$body = function() { return this.body; }; |
| 10668 TryStatement.prototype.set$body = function(value) { return this.body = value; }; | 10651 TryStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10669 TryStatement.prototype.visit = function(visitor) { | 10652 TryStatement.prototype.visit = function(visitor) { |
| 10670 return visitor.visitTryStatement(this); | 10653 return visitor.visitTryStatement$1(this); |
| 10671 } | 10654 } |
| 10672 TryStatement.prototype.visit$1 = TryStatement.prototype.visit; | 10655 TryStatement.prototype.visit$1 = TryStatement.prototype.visit; |
| 10673 // ********** Code for SwitchStatement ************** | 10656 // ********** Code for SwitchStatement ************** |
| 10674 $inherits(SwitchStatement, Statement); | 10657 $inherits(SwitchStatement, Statement); |
| 10675 function SwitchStatement(test, cases, span) { | 10658 function SwitchStatement(test, cases, span) { |
| 10676 this.test = test; | 10659 this.test = test; |
| 10677 this.cases = cases; | 10660 this.cases = cases; |
| 10678 Statement.call(this, span); | 10661 Statement.call(this, span); |
| 10679 } | 10662 } |
| 10680 SwitchStatement.prototype.get$cases = function() { return this.cases; }; | 10663 SwitchStatement.prototype.get$cases = function() { return this.cases; }; |
| 10681 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu
e; }; | 10664 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu
e; }; |
| 10682 SwitchStatement.prototype.visit = function(visitor) { | 10665 SwitchStatement.prototype.visit = function(visitor) { |
| 10683 return visitor.visitSwitchStatement(this); | 10666 return visitor.visitSwitchStatement$1(this); |
| 10684 } | 10667 } |
| 10685 SwitchStatement.prototype.visit$1 = SwitchStatement.prototype.visit; | 10668 SwitchStatement.prototype.visit$1 = SwitchStatement.prototype.visit; |
| 10686 // ********** Code for BlockStatement ************** | 10669 // ********** Code for BlockStatement ************** |
| 10687 $inherits(BlockStatement, Statement); | 10670 $inherits(BlockStatement, Statement); |
| 10688 function BlockStatement(body, span) { | 10671 function BlockStatement(body, span) { |
| 10689 this.body = body; | 10672 this.body = body; |
| 10690 Statement.call(this, span); | 10673 Statement.call(this, span); |
| 10691 } | 10674 } |
| 10692 BlockStatement.prototype.get$body = function() { return this.body; }; | 10675 BlockStatement.prototype.get$body = function() { return this.body; }; |
| 10693 BlockStatement.prototype.set$body = function(value) { return this.body = value;
}; | 10676 BlockStatement.prototype.set$body = function(value) { return this.body = value;
}; |
| 10694 BlockStatement.prototype.visit = function(visitor) { | 10677 BlockStatement.prototype.visit = function(visitor) { |
| 10695 return visitor.visitBlockStatement(this); | 10678 return visitor.visitBlockStatement$1(this); |
| 10696 } | 10679 } |
| 10697 BlockStatement.prototype.visit$1 = BlockStatement.prototype.visit; | 10680 BlockStatement.prototype.visit$1 = BlockStatement.prototype.visit; |
| 10698 // ********** Code for LabeledStatement ************** | 10681 // ********** Code for LabeledStatement ************** |
| 10699 $inherits(LabeledStatement, Statement); | 10682 $inherits(LabeledStatement, Statement); |
| 10700 function LabeledStatement(name, body, span) { | 10683 function LabeledStatement(name, body, span) { |
| 10701 this.body = body; | 10684 this.body = body; |
| 10702 this.name = name; | 10685 this.name = name; |
| 10703 Statement.call(this, span); | 10686 Statement.call(this, span); |
| 10704 } | 10687 } |
| 10705 LabeledStatement.prototype.get$name = function() { return this.name; }; | 10688 LabeledStatement.prototype.get$name = function() { return this.name; }; |
| 10706 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; | 10689 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; |
| 10707 LabeledStatement.prototype.get$body = function() { return this.body; }; | 10690 LabeledStatement.prototype.get$body = function() { return this.body; }; |
| 10708 LabeledStatement.prototype.set$body = function(value) { return this.body = value
; }; | 10691 LabeledStatement.prototype.set$body = function(value) { return this.body = value
; }; |
| 10709 LabeledStatement.prototype.visit = function(visitor) { | 10692 LabeledStatement.prototype.visit = function(visitor) { |
| 10710 return visitor.visitLabeledStatement(this); | 10693 return visitor.visitLabeledStatement$1(this); |
| 10711 } | 10694 } |
| 10712 LabeledStatement.prototype.visit$1 = LabeledStatement.prototype.visit; | 10695 LabeledStatement.prototype.visit$1 = LabeledStatement.prototype.visit; |
| 10713 // ********** Code for ExpressionStatement ************** | 10696 // ********** Code for ExpressionStatement ************** |
| 10714 $inherits(ExpressionStatement, Statement); | 10697 $inherits(ExpressionStatement, Statement); |
| 10715 function ExpressionStatement(body, span) { | 10698 function ExpressionStatement(body, span) { |
| 10716 this.body = body; | 10699 this.body = body; |
| 10717 Statement.call(this, span); | 10700 Statement.call(this, span); |
| 10718 } | 10701 } |
| 10719 ExpressionStatement.prototype.get$body = function() { return this.body; }; | 10702 ExpressionStatement.prototype.get$body = function() { return this.body; }; |
| 10720 ExpressionStatement.prototype.set$body = function(value) { return this.body = va
lue; }; | 10703 ExpressionStatement.prototype.set$body = function(value) { return this.body = va
lue; }; |
| 10721 ExpressionStatement.prototype.visit = function(visitor) { | 10704 ExpressionStatement.prototype.visit = function(visitor) { |
| 10722 return visitor.visitExpressionStatement(this); | 10705 return visitor.visitExpressionStatement$1(this); |
| 10723 } | 10706 } |
| 10724 ExpressionStatement.prototype.visit$1 = ExpressionStatement.prototype.visit; | 10707 ExpressionStatement.prototype.visit$1 = ExpressionStatement.prototype.visit; |
| 10725 // ********** Code for EmptyStatement ************** | 10708 // ********** Code for EmptyStatement ************** |
| 10726 $inherits(EmptyStatement, Statement); | 10709 $inherits(EmptyStatement, Statement); |
| 10727 function EmptyStatement(span) { | 10710 function EmptyStatement(span) { |
| 10728 Statement.call(this, span); | 10711 Statement.call(this, span); |
| 10729 } | 10712 } |
| 10730 EmptyStatement.prototype.visit = function(visitor) { | 10713 EmptyStatement.prototype.visit = function(visitor) { |
| 10731 return visitor.visitEmptyStatement(this); | 10714 return visitor.visitEmptyStatement$1(this); |
| 10732 } | 10715 } |
| 10733 EmptyStatement.prototype.visit$1 = EmptyStatement.prototype.visit; | 10716 EmptyStatement.prototype.visit$1 = EmptyStatement.prototype.visit; |
| 10734 // ********** Code for DietStatement ************** | 10717 // ********** Code for DietStatement ************** |
| 10735 $inherits(DietStatement, Statement); | 10718 $inherits(DietStatement, Statement); |
| 10736 function DietStatement(span) { | 10719 function DietStatement(span) { |
| 10737 Statement.call(this, span); | 10720 Statement.call(this, span); |
| 10738 } | 10721 } |
| 10739 DietStatement.prototype.visit = function(visitor) { | 10722 DietStatement.prototype.visit = function(visitor) { |
| 10740 return visitor.visitDietStatement(this); | 10723 return visitor.visitDietStatement$1(this); |
| 10741 } | 10724 } |
| 10742 DietStatement.prototype.visit$1 = DietStatement.prototype.visit; | 10725 DietStatement.prototype.visit$1 = DietStatement.prototype.visit; |
| 10743 // ********** Code for LambdaExpression ************** | 10726 // ********** Code for LambdaExpression ************** |
| 10744 $inherits(LambdaExpression, Expression); | 10727 $inherits(LambdaExpression, Expression); |
| 10745 function LambdaExpression(func, span) { | 10728 function LambdaExpression(func, span) { |
| 10746 this.func = func; | 10729 this.func = func; |
| 10747 Expression.call(this, span); | 10730 Expression.call(this, span); |
| 10748 } | 10731 } |
| 10749 LambdaExpression.prototype.get$func = function() { return this.func; }; | 10732 LambdaExpression.prototype.get$func = function() { return this.func; }; |
| 10750 LambdaExpression.prototype.set$func = function(value) { return this.func = value
; }; | 10733 LambdaExpression.prototype.set$func = function(value) { return this.func = value
; }; |
| 10751 LambdaExpression.prototype.visit = function(visitor) { | 10734 LambdaExpression.prototype.visit = function(visitor) { |
| 10752 return visitor.visitLambdaExpression(this); | 10735 return visitor.visitLambdaExpression$1(this); |
| 10753 } | 10736 } |
| 10754 LambdaExpression.prototype.visit$1 = LambdaExpression.prototype.visit; | 10737 LambdaExpression.prototype.visit$1 = LambdaExpression.prototype.visit; |
| 10755 // ********** Code for CallExpression ************** | 10738 // ********** Code for CallExpression ************** |
| 10756 $inherits(CallExpression, Expression); | 10739 $inherits(CallExpression, Expression); |
| 10757 function CallExpression(target, arguments, span) { | 10740 function CallExpression(target, arguments, span) { |
| 10758 this.target = target; | 10741 this.target = target; |
| 10759 this.arguments = arguments; | 10742 this.arguments = arguments; |
| 10760 Expression.call(this, span); | 10743 Expression.call(this, span); |
| 10761 } | 10744 } |
| 10762 CallExpression.prototype.visit = function(visitor) { | 10745 CallExpression.prototype.visit = function(visitor) { |
| 10763 return visitor.visitCallExpression(this); | 10746 return visitor.visitCallExpression(this); |
| 10764 } | 10747 } |
| 10765 CallExpression.prototype.visit$1 = CallExpression.prototype.visit; | 10748 CallExpression.prototype.visit$1 = CallExpression.prototype.visit; |
| 10766 // ********** Code for IndexExpression ************** | 10749 // ********** Code for IndexExpression ************** |
| 10767 $inherits(IndexExpression, Expression); | 10750 $inherits(IndexExpression, Expression); |
| 10768 function IndexExpression(target, index, span) { | 10751 function IndexExpression(target, index, span) { |
| 10769 this.target = target; | 10752 this.target = target; |
| 10770 this.index = index; | 10753 this.index = index; |
| 10771 Expression.call(this, span); | 10754 Expression.call(this, span); |
| 10772 } | 10755 } |
| 10773 IndexExpression.prototype.visit = function(visitor) { | 10756 IndexExpression.prototype.visit = function(visitor) { |
| 10774 return visitor.visitIndexExpression(this); | 10757 return visitor.visitIndexExpression$1(this); |
| 10775 } | 10758 } |
| 10776 IndexExpression.prototype.visit$1 = IndexExpression.prototype.visit; | 10759 IndexExpression.prototype.visit$1 = IndexExpression.prototype.visit; |
| 10777 // ********** Code for BinaryExpression ************** | 10760 // ********** Code for BinaryExpression ************** |
| 10778 $inherits(BinaryExpression, Expression); | 10761 $inherits(BinaryExpression, Expression); |
| 10779 function BinaryExpression(op, x, y, span) { | 10762 function BinaryExpression(op, x, y, span) { |
| 10780 this.y = y; | 10763 this.y = y; |
| 10781 this.x = x; | 10764 this.x = x; |
| 10782 this.op = op; | 10765 this.op = op; |
| 10783 Expression.call(this, span); | 10766 Expression.call(this, span); |
| 10784 } | 10767 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10831 this.isConst = isConst; | 10814 this.isConst = isConst; |
| 10832 Expression.call(this, span); | 10815 Expression.call(this, span); |
| 10833 } | 10816 } |
| 10834 NewExpression.prototype.get$isConst = function() { return this.isConst; }; | 10817 NewExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10835 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; | 10818 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 10836 NewExpression.prototype.get$type = function() { return this.type; }; | 10819 NewExpression.prototype.get$type = function() { return this.type; }; |
| 10837 NewExpression.prototype.set$type = function(value) { return this.type = value; }
; | 10820 NewExpression.prototype.set$type = function(value) { return this.type = value; }
; |
| 10838 NewExpression.prototype.get$name = function() { return this.name; }; | 10821 NewExpression.prototype.get$name = function() { return this.name; }; |
| 10839 NewExpression.prototype.set$name = function(value) { return this.name = value; }
; | 10822 NewExpression.prototype.set$name = function(value) { return this.name = value; }
; |
| 10840 NewExpression.prototype.visit = function(visitor) { | 10823 NewExpression.prototype.visit = function(visitor) { |
| 10841 return visitor.visitNewExpression(this); | 10824 return visitor.visitNewExpression$1(this); |
| 10842 } | 10825 } |
| 10843 NewExpression.prototype.visit$1 = NewExpression.prototype.visit; | 10826 NewExpression.prototype.visit$1 = NewExpression.prototype.visit; |
| 10844 // ********** Code for ListExpression ************** | 10827 // ********** Code for ListExpression ************** |
| 10845 $inherits(ListExpression, Expression); | 10828 $inherits(ListExpression, Expression); |
| 10846 function ListExpression(isConst, itemType, values, span) { | 10829 function ListExpression(isConst, itemType, values, span) { |
| 10847 this.itemType = itemType; | 10830 this.itemType = itemType; |
| 10848 this.isConst = isConst; | 10831 this.isConst = isConst; |
| 10849 this.values = values; | 10832 this.values = values; |
| 10850 Expression.call(this, span); | 10833 Expression.call(this, span); |
| 10851 } | 10834 } |
| 10852 ListExpression.prototype.get$isConst = function() { return this.isConst; }; | 10835 ListExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10853 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; | 10836 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; |
| 10854 ListExpression.prototype.visit = function(visitor) { | 10837 ListExpression.prototype.visit = function(visitor) { |
| 10855 return visitor.visitListExpression(this); | 10838 return visitor.visitListExpression(this); |
| 10856 } | 10839 } |
| 10857 ListExpression.prototype.visit$1 = ListExpression.prototype.visit; | 10840 ListExpression.prototype.visit$1 = ListExpression.prototype.visit; |
| 10858 // ********** Code for MapExpression ************** | 10841 // ********** Code for MapExpression ************** |
| 10859 $inherits(MapExpression, Expression); | 10842 $inherits(MapExpression, Expression); |
| 10860 function MapExpression(isConst, keyType, valueType, items, span) { | 10843 function MapExpression(isConst, keyType, valueType, items, span) { |
| 10861 this.keyType = keyType; | 10844 this.keyType = keyType; |
| 10862 this.valueType = valueType; | 10845 this.valueType = valueType; |
| 10863 this.items = items; | 10846 this.items = items; |
| 10864 this.isConst = isConst; | 10847 this.isConst = isConst; |
| 10865 Expression.call(this, span); | 10848 Expression.call(this, span); |
| 10866 } | 10849 } |
| 10867 MapExpression.prototype.get$isConst = function() { return this.isConst; }; | 10850 MapExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10868 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; | 10851 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 10869 MapExpression.prototype.visit = function(visitor) { | 10852 MapExpression.prototype.visit = function(visitor) { |
| 10870 return visitor.visitMapExpression(this); | 10853 return visitor.visitMapExpression$1(this); |
| 10871 } | 10854 } |
| 10872 MapExpression.prototype.visit$1 = MapExpression.prototype.visit; | 10855 MapExpression.prototype.visit$1 = MapExpression.prototype.visit; |
| 10873 // ********** Code for ConditionalExpression ************** | 10856 // ********** Code for ConditionalExpression ************** |
| 10874 $inherits(ConditionalExpression, Expression); | 10857 $inherits(ConditionalExpression, Expression); |
| 10875 function ConditionalExpression(test, trueBranch, falseBranch, span) { | 10858 function ConditionalExpression(test, trueBranch, falseBranch, span) { |
| 10876 this.test = test; | 10859 this.test = test; |
| 10877 this.falseBranch = falseBranch; | 10860 this.falseBranch = falseBranch; |
| 10878 this.trueBranch = trueBranch; | 10861 this.trueBranch = trueBranch; |
| 10879 Expression.call(this, span); | 10862 Expression.call(this, span); |
| 10880 } | 10863 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10969 SuperExpression.prototype.visit$1 = SuperExpression.prototype.visit; | 10952 SuperExpression.prototype.visit$1 = SuperExpression.prototype.visit; |
| 10970 // ********** Code for LiteralExpression ************** | 10953 // ********** Code for LiteralExpression ************** |
| 10971 $inherits(LiteralExpression, Expression); | 10954 $inherits(LiteralExpression, Expression); |
| 10972 function LiteralExpression(value, span) { | 10955 function LiteralExpression(value, span) { |
| 10973 this.value = value; | 10956 this.value = value; |
| 10974 Expression.call(this, span); | 10957 Expression.call(this, span); |
| 10975 } | 10958 } |
| 10976 LiteralExpression.prototype.get$value = function() { return this.value; }; | 10959 LiteralExpression.prototype.get$value = function() { return this.value; }; |
| 10977 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; | 10960 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; |
| 10978 LiteralExpression.prototype.visit = function(visitor) { | 10961 LiteralExpression.prototype.visit = function(visitor) { |
| 10979 return visitor.visitLiteralExpression(this); | 10962 return visitor.visitLiteralExpression$1(this); |
| 10980 } | 10963 } |
| 10981 LiteralExpression.prototype.visit$1 = LiteralExpression.prototype.visit; | 10964 LiteralExpression.prototype.visit$1 = LiteralExpression.prototype.visit; |
| 10982 // ********** Code for StringInterpExpression ************** | 10965 // ********** Code for StringInterpExpression ************** |
| 10983 $inherits(StringInterpExpression, Expression); | 10966 $inherits(StringInterpExpression, Expression); |
| 10984 function StringInterpExpression(pieces, span) { | 10967 function StringInterpExpression(pieces, span) { |
| 10985 this.pieces = pieces; | 10968 this.pieces = pieces; |
| 10986 Expression.call(this, span); | 10969 Expression.call(this, span); |
| 10987 } | 10970 } |
| 10988 StringInterpExpression.prototype.visit = function(visitor) { | 10971 StringInterpExpression.prototype.visit = function(visitor) { |
| 10989 return visitor.visitStringInterpExpression(this); | 10972 return visitor.visitStringInterpExpression(this); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11159 function DeclaredIdentifier(type, name, span) { | 11142 function DeclaredIdentifier(type, name, span) { |
| 11160 this.name = name; | 11143 this.name = name; |
| 11161 this.type = type; | 11144 this.type = type; |
| 11162 Expression.call(this, span); | 11145 Expression.call(this, span); |
| 11163 } | 11146 } |
| 11164 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; | 11147 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; |
| 11165 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val
ue; }; | 11148 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val
ue; }; |
| 11166 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; | 11149 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; |
| 11167 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; | 11150 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 11168 DeclaredIdentifier.prototype.visit = function(visitor) { | 11151 DeclaredIdentifier.prototype.visit = function(visitor) { |
| 11169 return visitor.visitDeclaredIdentifier(this); | 11152 return visitor.visitDeclaredIdentifier$1(this); |
| 11170 } | 11153 } |
| 11171 DeclaredIdentifier.prototype.visit$1 = DeclaredIdentifier.prototype.visit; | 11154 DeclaredIdentifier.prototype.visit$1 = DeclaredIdentifier.prototype.visit; |
| 11172 // ********** Code for Type ************** | 11155 // ********** Code for Type ************** |
| 11173 $inherits(Type, Element); | 11156 $inherits(Type, Element); |
| 11174 function Type(name) { | 11157 function Type(name) { |
| 11175 this.isTested = false; | 11158 this.isTested = false; |
| 11176 this._resolvedMembers = new HashMapImplementation(); | 11159 this._foundMembers = new HashMapImplementation(); |
| 11177 this.isChecked = false; | 11160 this.isChecked = false; |
| 11178 this.isWritten = false; | 11161 this.isWritten = false; |
| 11179 this.varStubs = new HashMapImplementation(); | 11162 this.varStubs = new HashMapImplementation(); |
| 11180 Element.call(this, name, null); | 11163 Element.call(this, name, null); |
| 11181 } | 11164 } |
| 11182 Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; }; | 11165 Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; }; |
| 11183 Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckCode =
value; }; | 11166 Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckCode =
value; }; |
| 11184 Type.prototype.get$varStubs = function() { return this.varStubs; }; | 11167 Type.prototype.get$varStubs = function() { return this.varStubs; }; |
| 11185 Type.prototype.set$varStubs = function(value) { return this.varStubs = value; }; | 11168 Type.prototype.set$varStubs = function(value) { return this.varStubs = value; }; |
| 11186 Type.prototype.markUsed = function() { | 11169 Type.prototype.markUsed = function() { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11312 var typeParam = params.next$0(); | 11295 var typeParam = params.next$0(); |
| 11313 var typeArg = args.next$0(); | 11296 var typeArg = args.next$0(); |
| 11314 if (typeParam.get$extendsType() != null && typeArg != null) { | 11297 if (typeParam.get$extendsType() != null && typeArg != null) { |
| 11315 typeArg.ensureSubtypeOf$3(typeParam.get$extendsType(), typeParam.get$spa
n(), true); | 11298 typeArg.ensureSubtypeOf$3(typeParam.get$extendsType(), typeParam.get$spa
n(), true); |
| 11316 } | 11299 } |
| 11317 } | 11300 } |
| 11318 } | 11301 } |
| 11319 if (this.get$interfaces() != null) { | 11302 if (this.get$interfaces() != null) { |
| 11320 var $$list = this.get$interfaces(); | 11303 var $$list = this.get$interfaces(); |
| 11321 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11304 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11322 var i = $$list.$index($$i); | 11305 var i = $$list[$$i]; |
| 11323 i._checkExtends$0(); | 11306 i._checkExtends$0(); |
| 11324 } | 11307 } |
| 11325 } | 11308 } |
| 11326 } | 11309 } |
| 11327 Type.prototype._checkOverride = function(member) { | 11310 Type.prototype._checkOverride = function(member) { |
| 11328 var parentMember = this._getMemberInParents(member.name); | 11311 var parentMember = this._getMemberInParents(member.name); |
| 11329 if (parentMember != null) { | 11312 if (parentMember != null) { |
| 11330 if (!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$li
brary())) { | 11313 if (!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$li
brary())) { |
| 11331 member.override(parentMember); | 11314 member.override(parentMember); |
| 11332 } | 11315 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 11351 return this.get$parent().getMember(memberName); | 11334 return this.get$parent().getMember(memberName); |
| 11352 } | 11335 } |
| 11353 else { | 11336 else { |
| 11354 return null; | 11337 return null; |
| 11355 } | 11338 } |
| 11356 } | 11339 } |
| 11357 else { | 11340 else { |
| 11358 if (this.get$interfaces() != null && this.get$interfaces().get$length() > (0
)) { | 11341 if (this.get$interfaces() != null && this.get$interfaces().get$length() > (0
)) { |
| 11359 var $$list = this.get$interfaces(); | 11342 var $$list = this.get$interfaces(); |
| 11360 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11343 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11361 var i = $$list.$index($$i); | 11344 var i = $$list[$$i]; |
| 11362 var ret = i.getMember$1(memberName); | 11345 var ret = i.getMember$1(memberName); |
| 11363 if (ret != null) { | 11346 if (ret != null) { |
| 11364 return ret; | 11347 return ret; |
| 11365 } | 11348 } |
| 11366 } | 11349 } |
| 11367 } | 11350 } |
| 11368 return $globals.world.objectType.getMember(memberName); | 11351 return $globals.world.objectType.getMember(memberName); |
| 11369 } | 11352 } |
| 11370 } | 11353 } |
| 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) { | 11354 Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { |
| 11402 if (!this.isSubtypeOf(other)) { | 11355 if (!this.isSubtypeOf(other)) { |
| 11403 var msg = ("type " + this.name + " is not a subtype of " + other.name); | 11356 var msg = ("type " + this.name + " is not a subtype of " + other.name); |
| 11404 if (typeErrors) { | 11357 if (typeErrors) { |
| 11405 $globals.world.error(msg, span); | 11358 $globals.world.error(msg, span); |
| 11406 } | 11359 } |
| 11407 else { | 11360 else { |
| 11408 $globals.world.warning(msg, span); | 11361 $globals.world.warning(msg, span); |
| 11409 } | 11362 } |
| 11410 } | 11363 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11539 } | 11492 } |
| 11540 ParameterType.prototype.getCallMethod = function() { | 11493 ParameterType.prototype.getCallMethod = function() { |
| 11541 return this.extendsType.getCallMethod(); | 11494 return this.extendsType.getCallMethod(); |
| 11542 } | 11495 } |
| 11543 ParameterType.prototype.genMethod = function(method) { | 11496 ParameterType.prototype.genMethod = function(method) { |
| 11544 this.extendsType.genMethod(method); | 11497 this.extendsType.genMethod(method); |
| 11545 } | 11498 } |
| 11546 ParameterType.prototype.isSubtypeOf = function(other) { | 11499 ParameterType.prototype.isSubtypeOf = function(other) { |
| 11547 return true; | 11500 return true; |
| 11548 } | 11501 } |
| 11549 ParameterType.prototype.resolveMember = function(memberName) { | |
| 11550 return this.extendsType.resolveMember(memberName); | |
| 11551 } | |
| 11552 ParameterType.prototype.getConstructor = function(constructorName) { | 11502 ParameterType.prototype.getConstructor = function(constructorName) { |
| 11553 $globals.world.internalError("no constructors on type parameters yet"); | 11503 $globals.world.internalError("no constructors on type parameters yet"); |
| 11554 } | 11504 } |
| 11555 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11505 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 11556 $globals.world.internalError("no concrete types of type parameters yet", this.
get$span()); | 11506 $globals.world.internalError("no concrete types of type parameters yet", this.
get$span()); |
| 11557 } | 11507 } |
| 11558 ParameterType.prototype.resolveTypeParams = function(inType) { | 11508 ParameterType.prototype.resolveTypeParams = function(inType) { |
| 11559 return inType.typeArguments.$index(this.name); | 11509 return inType.typeArguments.$index(this.name); |
| 11560 } | 11510 } |
| 11561 ParameterType.prototype.addDirectSubtype = function(type) { | 11511 ParameterType.prototype.addDirectSubtype = function(type) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 11588 NonNullableType.prototype.get$isBool = function() { | 11538 NonNullableType.prototype.get$isBool = function() { |
| 11589 return this.type.get$isBool(); | 11539 return this.type.get$isBool(); |
| 11590 } | 11540 } |
| 11591 NonNullableType.prototype.get$isUsed = function() { | 11541 NonNullableType.prototype.get$isUsed = function() { |
| 11592 return false; | 11542 return false; |
| 11593 } | 11543 } |
| 11594 NonNullableType.prototype.isSubtypeOf = function(other) { | 11544 NonNullableType.prototype.isSubtypeOf = function(other) { |
| 11595 return $eq(this, other) || $eq(this.type, other) || this.type.isSubtypeOf(othe
r); | 11545 return $eq(this, other) || $eq(this.type, other) || this.type.isSubtypeOf(othe
r); |
| 11596 } | 11546 } |
| 11597 NonNullableType.prototype.resolveType = function(node, isRequired) { | 11547 NonNullableType.prototype.resolveType = function(node, isRequired) { |
| 11598 return this.type.resolveType(node, isRequired); | 11548 return this.type.resolveType$2(node, isRequired); |
| 11599 } | 11549 } |
| 11600 NonNullableType.prototype.resolveTypeParams = function(inType) { | 11550 NonNullableType.prototype.resolveTypeParams = function(inType) { |
| 11601 return this.type.resolveTypeParams(inType); | 11551 return this.type.resolveTypeParams(inType); |
| 11602 } | 11552 } |
| 11603 NonNullableType.prototype.addDirectSubtype = function(subtype) { | 11553 NonNullableType.prototype.addDirectSubtype = function(subtype) { |
| 11604 this.type.addDirectSubtype(subtype); | 11554 this.type.addDirectSubtype$1(subtype); |
| 11605 } | 11555 } |
| 11606 NonNullableType.prototype.markUsed = function() { | 11556 NonNullableType.prototype.markUsed = function() { |
| 11607 this.type.markUsed(); | 11557 this.type.markUsed(); |
| 11608 } | 11558 } |
| 11609 NonNullableType.prototype.genMethod = function(method) { | 11559 NonNullableType.prototype.genMethod = function(method) { |
| 11610 this.type.genMethod(method); | 11560 this.type.genMethod(method); |
| 11611 } | 11561 } |
| 11612 NonNullableType.prototype.get$span = function() { | 11562 NonNullableType.prototype.get$span = function() { |
| 11613 return this.type.get$span(); | 11563 return this.type.get$span(); |
| 11614 } | 11564 } |
| 11615 NonNullableType.prototype.resolveMember = function(name) { | |
| 11616 return this.type.resolveMember(name); | |
| 11617 } | |
| 11618 NonNullableType.prototype.getMember = function(name) { | 11565 NonNullableType.prototype.getMember = function(name) { |
| 11619 return this.type.getMember(name); | 11566 return this.type.getMember(name); |
| 11620 } | 11567 } |
| 11621 NonNullableType.prototype.getConstructor = function(name) { | 11568 NonNullableType.prototype.getConstructor = function(name) { |
| 11622 return this.type.getConstructor$1(name); | 11569 return this.type.getConstructor$1(name); |
| 11623 } | 11570 } |
| 11624 NonNullableType.prototype.getFactory = function(t, name) { | 11571 NonNullableType.prototype.getFactory = function(t, name) { |
| 11625 return this.type.getFactory$2(t, name); | 11572 return this.type.getFactory$2(t, name); |
| 11626 } | 11573 } |
| 11627 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11574 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11712 ConcreteType.prototype.get$isClass = function() { | 11659 ConcreteType.prototype.get$isClass = function() { |
| 11713 return this.genericType.isClass; | 11660 return this.genericType.isClass; |
| 11714 } | 11661 } |
| 11715 ConcreteType.prototype.get$library = function() { | 11662 ConcreteType.prototype.get$library = function() { |
| 11716 return this.genericType.library; | 11663 return this.genericType.library; |
| 11717 } | 11664 } |
| 11718 ConcreteType.prototype.get$span = function() { | 11665 ConcreteType.prototype.get$span = function() { |
| 11719 return this.genericType.get$span(); | 11666 return this.genericType.get$span(); |
| 11720 } | 11667 } |
| 11721 ConcreteType.prototype.get$hasTypeParams = function() { | 11668 ConcreteType.prototype.get$hasTypeParams = function() { |
| 11722 return this.typeArguments.getValues$0().some$1((function (e) { | 11669 return this.typeArguments.getValues().some((function (e) { |
| 11723 return (e instanceof ParameterType); | 11670 return (e instanceof ParameterType); |
| 11724 }) | 11671 }) |
| 11725 ); | 11672 ); |
| 11726 } | 11673 } |
| 11727 ConcreteType.prototype.get$isUsed = function() { return this.isUsed; }; | 11674 ConcreteType.prototype.get$isUsed = function() { return this.isUsed; }; |
| 11728 ConcreteType.prototype.set$isUsed = function(value) { return this.isUsed = value
; }; | 11675 ConcreteType.prototype.set$isUsed = function(value) { return this.isUsed = value
; }; |
| 11729 ConcreteType.prototype.get$members = function() { return this.members; }; | 11676 ConcreteType.prototype.get$members = function() { return this.members; }; |
| 11730 ConcreteType.prototype.set$members = function(value) { return this.members = val
ue; }; | 11677 ConcreteType.prototype.set$members = function(value) { return this.members = val
ue; }; |
| 11731 ConcreteType.prototype.get$constructors = function() { return this.constructors;
}; | 11678 ConcreteType.prototype.get$constructors = function() { return this.constructors;
}; |
| 11732 ConcreteType.prototype.set$constructors = function(value) { return this.construc
tors = value; }; | 11679 ConcreteType.prototype.set$constructors = function(value) { return this.construc
tors = value; }; |
| 11733 ConcreteType.prototype.get$factories = function() { return this.factories; }; | 11680 ConcreteType.prototype.get$factories = function() { return this.factories; }; |
| 11734 ConcreteType.prototype.set$factories = function(value) { return this.factories =
value; }; | 11681 ConcreteType.prototype.set$factories = function(value) { return this.factories =
value; }; |
| 11735 ConcreteType.prototype.resolveTypeParams = function(inType) { | 11682 ConcreteType.prototype.resolveTypeParams = function(inType) { |
| 11736 var newTypeArgs = []; | 11683 var newTypeArgs = []; |
| 11737 var needsNewType = false; | 11684 var needsNewType = false; |
| 11738 var $$list = this.typeArgsInOrder; | 11685 var $$list = this.typeArgsInOrder; |
| 11739 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11686 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11740 var t = $$list.$index($$i); | 11687 var t = $$list[$$i]; |
| 11741 var newType = t.resolveTypeParams$1(inType); | 11688 var newType = t.resolveTypeParams$1(inType); |
| 11742 if ($ne(newType, t)) needsNewType = true; | 11689 if ($ne(newType, t)) needsNewType = true; |
| 11743 newTypeArgs.add$1(newType); | 11690 newTypeArgs.add$1(newType); |
| 11744 } | 11691 } |
| 11745 if (!needsNewType) return this; | 11692 if (!needsNewType) return this; |
| 11746 return this.genericType.getOrMakeConcreteType(newTypeArgs); | 11693 return this.genericType.getOrMakeConcreteType(newTypeArgs); |
| 11747 } | 11694 } |
| 11748 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11695 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 11749 return this.genericType.getOrMakeConcreteType(typeArgs); | 11696 return this.genericType.getOrMakeConcreteType(typeArgs); |
| 11750 } | 11697 } |
| 11751 ConcreteType.prototype.get$parent = function() { | 11698 ConcreteType.prototype.get$parent = function() { |
| 11752 if (this._parent == null && this.genericType.get$parent() != null) { | 11699 if (this._parent == null && this.genericType.get$parent() != null) { |
| 11753 this._parent = this.genericType.get$parent().resolveTypeParams(this); | 11700 this._parent = this.genericType.get$parent().resolveTypeParams(this); |
| 11754 } | 11701 } |
| 11755 return this._parent; | 11702 return this._parent; |
| 11756 } | 11703 } |
| 11757 ConcreteType.prototype.get$interfaces = function() { | 11704 ConcreteType.prototype.get$interfaces = function() { |
| 11758 if (this._interfaces == null && this.genericType.interfaces != null) { | 11705 if (this._interfaces == null && this.genericType.interfaces != null) { |
| 11759 this._interfaces = []; | 11706 this._interfaces = []; |
| 11760 var $$list = this.genericType.interfaces; | 11707 var $$list = this.genericType.interfaces; |
| 11761 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11708 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11762 var i = $$list.$index($$i); | 11709 var i = $$list[$$i]; |
| 11763 this._interfaces.add(i.resolveTypeParams$1(this)); | 11710 this._interfaces.add(i.resolveTypeParams$1(this)); |
| 11764 } | 11711 } |
| 11765 } | 11712 } |
| 11766 return this._interfaces; | 11713 return this._interfaces; |
| 11767 } | 11714 } |
| 11768 ConcreteType.prototype.get$subtypes = function() { | 11715 ConcreteType.prototype.get$subtypes = function() { |
| 11769 if (this._subtypes == null) { | 11716 if (this._subtypes == null) { |
| 11770 this._subtypes = new HashSetImplementation(); | 11717 this._subtypes = new HashSetImplementation(); |
| 11771 var $$list = this.genericType.get$subtypes(); | 11718 var $$list = this.genericType.get$subtypes(); |
| 11772 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 11719 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); | 11768 ret = new ConcreteMember(genericMember.get$name(), this, genericMember); |
| 11822 this.factories.addFactory(this.name, constructorName, ret); | 11769 this.factories.addFactory(this.name, constructorName, ret); |
| 11823 } | 11770 } |
| 11824 else { | 11771 else { |
| 11825 ret = new ConcreteMember(this.name, this, genericMember); | 11772 ret = new ConcreteMember(this.name, this, genericMember); |
| 11826 this.constructors.$setindex(constructorName, ret); | 11773 this.constructors.$setindex(constructorName, ret); |
| 11827 } | 11774 } |
| 11828 return ret; | 11775 return ret; |
| 11829 } | 11776 } |
| 11830 ConcreteType.prototype.getMember = function(memberName) { | 11777 ConcreteType.prototype.getMember = function(memberName) { |
| 11831 var member = this.members.$index(memberName); | 11778 var member = this._foundMembers.$index(memberName); |
| 11779 if (member != null) return member; |
| 11780 member = this.members.$index(memberName); |
| 11832 if (member != null) { | 11781 if (member != null) { |
| 11833 this._checkOverride(member); | 11782 this._checkOverride(member); |
| 11783 this._foundMembers.$setindex(memberName, member); |
| 11834 return member; | 11784 return member; |
| 11835 } | 11785 } |
| 11836 var genericMember = this.genericType.members.$index(memberName); | 11786 var genericMember = this.genericType.members.$index(memberName); |
| 11837 if (genericMember != null) { | 11787 if (genericMember != null) { |
| 11838 member = new ConcreteMember(genericMember.get$name(), this, genericMember); | 11788 member = new ConcreteMember(genericMember.get$name(), this, genericMember); |
| 11839 this.members.$setindex(memberName, member); | 11789 this.members.$setindex(memberName, member); |
| 11790 this._foundMembers.$setindex(memberName, member); |
| 11840 return member; | 11791 return member; |
| 11841 } | 11792 } |
| 11842 return this._getMemberInParents(memberName); | 11793 member = this._getMemberInParents(memberName); |
| 11794 this._foundMembers.$setindex(memberName, member); |
| 11795 return member; |
| 11843 } | 11796 } |
| 11844 ConcreteType.prototype.resolveType = function(node, isRequired) { | 11797 ConcreteType.prototype.resolveType = function(node, isRequired) { |
| 11845 var ret = this.genericType.resolveType(node, isRequired); | 11798 var ret = this.genericType.resolveType$2(node, isRequired); |
| 11846 return ret; | 11799 return ret; |
| 11847 } | 11800 } |
| 11848 ConcreteType.prototype.addDirectSubtype = function(type) { | 11801 ConcreteType.prototype.addDirectSubtype = function(type) { |
| 11849 this.genericType.addDirectSubtype(type); | 11802 this.genericType.addDirectSubtype(type); |
| 11850 } | 11803 } |
| 11851 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt
ype; | 11804 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt
ype; |
| 11852 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; | 11805 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; |
| 11853 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; | 11806 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; |
| 11854 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; | 11807 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; |
| 11855 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak
eConcreteType; | 11808 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak
eConcreteType; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11967 DefinedType.prototype.getAllMembers = function() { | 11920 DefinedType.prototype.getAllMembers = function() { |
| 11968 return HashMapImplementation.HashMapImplementation$from$factory(this.members); | 11921 return HashMapImplementation.HashMapImplementation$from$factory(this.members); |
| 11969 } | 11922 } |
| 11970 DefinedType.prototype.markUsed = function() { | 11923 DefinedType.prototype.markUsed = function() { |
| 11971 if (this.isUsed) return; | 11924 if (this.isUsed) return; |
| 11972 this.isUsed = true; | 11925 this.isUsed = true; |
| 11973 this._checkExtends(); | 11926 this._checkExtends(); |
| 11974 if (this._lazyGenMethods != null) { | 11927 if (this._lazyGenMethods != null) { |
| 11975 var $$list = orderValuesByKeys(this._lazyGenMethods); | 11928 var $$list = orderValuesByKeys(this._lazyGenMethods); |
| 11976 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11929 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11977 var method = $$list.$index($$i); | 11930 var method = $$list[$$i]; |
| 11978 $globals.world.gen.genMethod(method); | 11931 $globals.world.gen.genMethod(method); |
| 11979 } | 11932 } |
| 11980 this._lazyGenMethods = null; | 11933 this._lazyGenMethods = null; |
| 11981 } | 11934 } |
| 11982 if (this.get$parent() != null) this.get$parent().markUsed(); | 11935 if (this.get$parent() != null) this.get$parent().markUsed(); |
| 11983 } | 11936 } |
| 11984 DefinedType.prototype.genMethod = function(method) { | 11937 DefinedType.prototype.genMethod = function(method) { |
| 11985 if (this.isUsed) { | 11938 if (this.isUsed) { |
| 11986 $globals.world.gen.genMethod(method); | 11939 $globals.world.gen.genMethod(method); |
| 11987 } | 11940 } |
| 11988 else if (this.isClass) { | 11941 else if (this.isClass) { |
| 11989 if (this._lazyGenMethods == null) this._lazyGenMethods = new HashMapImplemen
tation(); | 11942 if (this._lazyGenMethods == null) this._lazyGenMethods = new HashMapImplemen
tation(); |
| 11990 this._lazyGenMethods.$setindex(method.name, method); | 11943 this._lazyGenMethods.$setindex(method.name, method); |
| 11991 } | 11944 } |
| 11992 } | 11945 } |
| 11993 DefinedType.prototype._resolveInterfaces = function(types) { | 11946 DefinedType.prototype._resolveInterfaces = function(types) { |
| 11994 if (types == null) return []; | 11947 if (types == null) return []; |
| 11995 var interfaces = []; | 11948 var interfaces = []; |
| 11996 for (var $$i = 0;$$i < types.get$length(); $$i++) { | 11949 for (var $$i = 0;$$i < types.get$length(); $$i++) { |
| 11997 var type = types.$index($$i); | 11950 var type = types[$$i]; |
| 11998 var resolvedInterface = this.resolveType(type, true); | 11951 var resolvedInterface = this.resolveType$2(type, true); |
| 11999 if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this.
library.get$isCoreImpl())) { | 11952 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()); | 11953 $globals.world.error(("can not implement \"" + resolvedInterface.get$name(
) + "\": ") + "only native implementation allowed", type.get$span()); |
| 12001 } | 11954 } |
| 12002 resolvedInterface.addDirectSubtype$1(this); | 11955 resolvedInterface.addDirectSubtype$1(this); |
| 12003 interfaces.add$1(resolvedInterface); | 11956 interfaces.add$1(resolvedInterface); |
| 12004 } | 11957 } |
| 12005 return interfaces; | 11958 return interfaces; |
| 12006 } | 11959 } |
| 12007 DefinedType.prototype.addDirectSubtype = function(type) { | 11960 DefinedType.prototype.addDirectSubtype = function(type) { |
| 12008 this.directSubtypes.add(type); | 11961 this.directSubtypes.add(type); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12043 if (ancestor == null) return false; | 11996 if (ancestor == null) return false; |
| 12044 if (ancestor == $this) return true; | 11997 if (ancestor == $this) return true; |
| 12045 if (seen.contains$1(ancestor)) { | 11998 if (seen.contains$1(ancestor)) { |
| 12046 return false; | 11999 return false; |
| 12047 } | 12000 } |
| 12048 seen.add$1(ancestor); | 12001 seen.add$1(ancestor); |
| 12049 if (ancestor.get$interfaces() != null) { | 12002 if (ancestor.get$interfaces() != null) { |
| 12050 var $$list = ancestor.get$interfaces(); | 12003 var $$list = ancestor.get$interfaces(); |
| 12051 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12004 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12052 var parent = $$i.next$0(); | 12005 var parent = $$i.next$0(); |
| 12053 if (_helper(parent)) return true; | 12006 if (_helper.call$1(parent)) return true; |
| 12054 } | 12007 } |
| 12055 } | 12008 } |
| 12056 return false; | 12009 return false; |
| 12057 } | 12010 } |
| 12058 for (var i = (0); | 12011 for (var i = (0); |
| 12059 i < this.interfaces.get$length(); i++) { | 12012 i < this.interfaces.get$length(); i++) { |
| 12060 if (_helper(this.interfaces.$index(i))) return i; | 12013 if (_helper.call$1(this.interfaces[i])) return i; |
| 12061 } | 12014 } |
| 12062 return (-1); | 12015 return (-1); |
| 12063 } | 12016 } |
| 12064 DefinedType.prototype.resolve = function() { | 12017 DefinedType.prototype.resolve = function() { |
| 12065 if ((this.definition instanceof TypeDefinition)) { | 12018 if ((this.definition instanceof TypeDefinition)) { |
| 12066 var typeDef = this.definition; | 12019 var typeDef = this.definition; |
| 12067 if (this.isClass) { | 12020 if (this.isClass) { |
| 12068 if (typeDef.extendsTypes != null && typeDef.extendsTypes.get$length() > (0
)) { | 12021 if (typeDef.extendsTypes != null && typeDef.extendsTypes.get$length() > (0
)) { |
| 12069 if (typeDef.extendsTypes.get$length() > (1)) { | 12022 if (typeDef.extendsTypes.get$length() > (1)) { |
| 12070 $globals.world.error("more than one base class", typeDef.extendsTypes.
$index((1)).get$span()); | 12023 $globals.world.error("more than one base class", typeDef.extendsTypes[
(1)].get$span()); |
| 12071 } | 12024 } |
| 12072 var extendsTypeRef = typeDef.extendsTypes.$index((0)); | 12025 var extendsTypeRef = typeDef.extendsTypes[(0)]; |
| 12073 if ((extendsTypeRef instanceof GenericTypeReference)) { | 12026 if ((extendsTypeRef instanceof GenericTypeReference)) { |
| 12074 var g = extendsTypeRef; | 12027 var g = extendsTypeRef; |
| 12075 this.set$parent(this.resolveType(g.baseType, true)); | 12028 this.set$parent(this.resolveType$2(g.baseType, true)); |
| 12076 } | 12029 } |
| 12077 this.set$parent(this.resolveType(extendsTypeRef, true)); | 12030 this.set$parent(this.resolveType$2(extendsTypeRef, true)); |
| 12078 if (!this.get$parent().get$isClass()) { | 12031 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()); | 12032 $globals.world.error("class may not extend an interface - use implemen
ts", typeDef.extendsTypes[(0)].get$span()); |
| 12080 } | 12033 } |
| 12081 this.get$parent().addDirectSubtype(this); | 12034 this.get$parent().addDirectSubtype$1(this); |
| 12082 if (this._cycleInClassExtends()) { | 12035 if (this._cycleInClassExtends()) { |
| 12083 $globals.world.error(("class \"" + this.name + "\" has a cycle in its
inheritance chain"), extendsTypeRef.get$span()); | 12036 $globals.world.error(("class \"" + this.name + "\" has a cycle in its
inheritance chain"), extendsTypeRef.get$span()); |
| 12084 } | 12037 } |
| 12085 } | 12038 } |
| 12086 else { | 12039 else { |
| 12087 if (!this.get$isObject()) { | 12040 if (!this.get$isObject()) { |
| 12088 this.set$parent($globals.world.objectType); | 12041 this.set$parent($globals.world.objectType); |
| 12089 this.get$parent().addDirectSubtype(this); | 12042 this.get$parent().addDirectSubtype$1(this); |
| 12090 } | 12043 } |
| 12091 } | 12044 } |
| 12092 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); | 12045 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); |
| 12093 if (typeDef.defaultType != null) { | 12046 if (typeDef.defaultType != null) { |
| 12094 $globals.world.error("default not allowed on classes", typeDef.defaultTy
pe.span); | 12047 $globals.world.error("default not allowed on classes", typeDef.defaultTy
pe.span); |
| 12095 } | 12048 } |
| 12096 } | 12049 } |
| 12097 else { | 12050 else { |
| 12098 if (typeDef.implementsTypes != null && typeDef.implementsTypes.get$length(
) > (0)) { | 12051 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()); | 12052 $globals.world.error("implements not allowed on interfaces (use extends)
", typeDef.implementsTypes[(0)].get$span()); |
| 12100 } | 12053 } |
| 12101 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); | 12054 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); |
| 12102 var res = this._cycleInInterfaceExtends(); | 12055 var res = this._cycleInInterfaceExtends(); |
| 12103 if (res >= (0)) { | 12056 if (res >= (0)) { |
| 12104 $globals.world.error(("interface \"" + this.name + "\" has a cycle in it
s inheritance chain"), typeDef.extendsTypes.$index(res).get$span()); | 12057 $globals.world.error(("interface \"" + this.name + "\" has a cycle in it
s inheritance chain"), typeDef.extendsTypes[res].get$span()); |
| 12105 } | 12058 } |
| 12106 if (typeDef.defaultType != null) { | 12059 if (typeDef.defaultType != null) { |
| 12107 this.defaultType = this.resolveType(typeDef.defaultType.baseType, true); | 12060 this.defaultType = this.resolveType$2(typeDef.defaultType.baseType, true
); |
| 12108 if (this.defaultType == null) { | 12061 if (this.defaultType == null) { |
| 12109 $globals.world.warning("unresolved default class", typeDef.defaultType
.span); | 12062 $globals.world.warning("unresolved default class", typeDef.defaultType
.span); |
| 12110 } | 12063 } |
| 12111 else { | 12064 else { |
| 12112 this.defaultType._resolveTypeParams(typeDef.defaultType.typeParameters
); | 12065 this.defaultType._resolveTypeParams(typeDef.defaultType.typeParameters
); |
| 12113 } | 12066 } |
| 12114 } | 12067 } |
| 12115 } | 12068 } |
| 12116 } | 12069 } |
| 12117 else if ((this.definition instanceof FunctionTypeDefinition)) { | 12070 else if ((this.definition instanceof FunctionTypeDefinition)) { |
| 12118 this.interfaces = [$globals.world.functionType]; | 12071 this.interfaces = [$globals.world.functionType]; |
| 12119 } | 12072 } |
| 12120 this._resolveTypeParams(this.typeParameters); | 12073 this._resolveTypeParams(this.typeParameters); |
| 12121 if (this.get$isObject()) this._createNotEqualMember(); | 12074 if (this.get$isObject()) this._createNotEqualMember(); |
| 12122 $globals.world._addType(this); | 12075 $globals.world._addType(this); |
| 12123 var $$list = this.constructors.getValues$0(); | 12076 var $$list = this.constructors.getValues(); |
| 12124 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12077 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12125 var c = $$i.next$0(); | 12078 var c = $$i.next$0(); |
| 12126 c.resolve$0(); | 12079 c.resolve$0(); |
| 12127 } | 12080 } |
| 12128 var $$list = this.members.getValues$0(); | 12081 var $$list = this.members.getValues(); |
| 12129 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12082 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12130 var m = $$i.next$0(); | 12083 var m = $$i.next$0(); |
| 12131 m.resolve$0(); | 12084 m.resolve$0(); |
| 12132 } | 12085 } |
| 12133 this.factories.forEach((function (f) { | 12086 this.factories.forEach((function (f) { |
| 12134 return f.resolve$0(); | 12087 return f.resolve$0(); |
| 12135 }) | 12088 }) |
| 12136 ); | 12089 ); |
| 12137 if (this.get$isJsGlobalObject()) { | 12090 if (this.get$isJsGlobalObject()) { |
| 12138 var $$list = this.members.getValues$0(); | 12091 var $$list = this.members.getValues(); |
| 12139 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12092 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12140 var m = $$i.next$0(); | 12093 var m = $$i.next$0(); |
| 12141 if (!m.get$isStatic()) $globals.world._addTopName(m); | 12094 if (!m.get$isStatic()) $globals.world._addTopName(m); |
| 12142 } | 12095 } |
| 12143 } | 12096 } |
| 12144 } | 12097 } |
| 12145 DefinedType.prototype._resolveTypeParams = function(params) { | 12098 DefinedType.prototype._resolveTypeParams = function(params) { |
| 12146 if (params == null) return; | 12099 if (params == null) return; |
| 12147 for (var $$i = 0;$$i < params.get$length(); $$i++) { | 12100 for (var $$i = 0;$$i < params.get$length(); $$i++) { |
| 12148 var tp = params.$index($$i); | 12101 var tp = params[$$i]; |
| 12149 tp.set$enclosingElement(this); | 12102 tp.set$enclosingElement(this); |
| 12150 tp.resolve$0(); | 12103 tp.resolve$0(); |
| 12151 } | 12104 } |
| 12152 } | 12105 } |
| 12153 DefinedType.prototype.addMethod = function(methodName, definition) { | 12106 DefinedType.prototype.addMethod = function(methodName, definition) { |
| 12154 if (methodName == null) methodName = definition.name.name; | 12107 if (methodName == null) methodName = definition.name.name; |
| 12155 var method = new MethodMember(methodName, this, definition); | 12108 var method = new MethodMember(methodName, this, definition); |
| 12156 if (method.get$isConstructor()) { | 12109 if (method.get$isConstructor()) { |
| 12157 if (this.constructors.containsKey(method.get$constructorName())) { | 12110 if (this.constructors.containsKey(method.get$constructorName())) { |
| 12158 $globals.world.error(("duplicate constructor definition of " + method.get$
name()), definition.span); | 12111 $globals.world.error(("duplicate constructor definition of " + method.get$
name()), definition.span); |
| 12159 return; | 12112 return; |
| 12160 } | 12113 } |
| 12161 this.constructors.$setindex(method.get$constructorName(), method); | 12114 this.constructors.$setindex(method.get$constructorName(), method); |
| 12162 return; | 12115 return; |
| 12163 } | 12116 } |
| 12164 if (definition.modifiers != null && definition.modifiers.get$length() == (1) &
& $eq(definition.modifiers.$index((0)).get$kind(), (74))) { | 12117 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) { | 12118 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); | 12119 $globals.world.error(("duplicate factory definition of \"" + method.get$na
me() + "\""), definition.span); |
| 12167 return; | 12120 return; |
| 12168 } | 12121 } |
| 12169 this.factories.addFactory(method.get$constructorName(), method.get$name(), m
ethod); | 12122 this.factories.addFactory(method.get$constructorName(), method.get$name(), m
ethod); |
| 12170 return; | 12123 return; |
| 12171 } | 12124 } |
| 12172 if (methodName.startsWith("get:") || methodName.startsWith("set:")) { | 12125 if (methodName.startsWith("get:") || methodName.startsWith("set:")) { |
| 12173 var propName = methodName.substring((4)); | 12126 var propName = methodName.substring((4)); |
| 12174 var prop = this.members.$index(propName); | 12127 var prop = this.members.$index(propName); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 12196 } | 12149 } |
| 12197 if (this.members.containsKey(methodName)) { | 12150 if (this.members.containsKey(methodName)) { |
| 12198 $globals.world.error(("duplicate method definition of \"" + method.get$name(
) + "\""), definition.span); | 12151 $globals.world.error(("duplicate method definition of \"" + method.get$name(
) + "\""), definition.span); |
| 12199 return; | 12152 return; |
| 12200 } | 12153 } |
| 12201 this.members.$setindex(methodName, method); | 12154 this.members.$setindex(methodName, method); |
| 12202 } | 12155 } |
| 12203 DefinedType.prototype.addField = function(definition) { | 12156 DefinedType.prototype.addField = function(definition) { |
| 12204 for (var i = (0); | 12157 for (var i = (0); |
| 12205 i < definition.names.get$length(); i++) { | 12158 i < definition.names.get$length(); i++) { |
| 12206 var name = definition.names.$index(i).get$name(); | 12159 var name = definition.names[i].get$name(); |
| 12207 if (this.members.containsKey(name)) { | 12160 if (this.members.containsKey(name)) { |
| 12208 $globals.world.error(("duplicate field definition of \"" + name + "\""), d
efinition.span); | 12161 $globals.world.error(("duplicate field definition of \"" + name + "\""), d
efinition.span); |
| 12209 return; | 12162 return; |
| 12210 } | 12163 } |
| 12211 var value = null; | 12164 var value = null; |
| 12212 if (definition.values != null) { | 12165 if (definition.values != null) { |
| 12213 value = definition.values.$index(i); | 12166 value = definition.values[i]; |
| 12214 } | 12167 } |
| 12215 var field = new FieldMember(name, this, definition, value); | 12168 var field = new FieldMember(name, this, definition, value); |
| 12216 this.members.$setindex(name, field); | 12169 this.members.$setindex(name, field); |
| 12217 if (this.isNative) { | 12170 if (this.isNative) { |
| 12218 field.set$isNative(true); | 12171 field.set$isNative(true); |
| 12219 } | 12172 } |
| 12220 } | 12173 } |
| 12221 } | 12174 } |
| 12222 DefinedType.prototype.getFactory = function(type, constructorName) { | 12175 DefinedType.prototype.getFactory = function(type, constructorName) { |
| 12223 var ret = this.factories.getFactory(type.name, constructorName); | 12176 var ret = this.factories.getFactory(type.name, constructorName); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 12242 return this._tryCreateDefaultConstructor(constructorName); | 12195 return this._tryCreateDefaultConstructor(constructorName); |
| 12243 } | 12196 } |
| 12244 DefinedType.prototype._checkDefaultTypeParams = function() { | 12197 DefinedType.prototype._checkDefaultTypeParams = function() { |
| 12245 function toList(list) { | 12198 function toList(list) { |
| 12246 return (list != null ? list : const$0008); | 12199 return (list != null ? list : const$0008); |
| 12247 } | 12200 } |
| 12248 var typeDef = this.definition; | 12201 var typeDef = this.definition; |
| 12249 if (typeDef.defaultType.oldFactory) { | 12202 if (typeDef.defaultType.oldFactory) { |
| 12250 return; | 12203 return; |
| 12251 } | 12204 } |
| 12252 var interfaceParams = toList(this.typeParameters); | 12205 var interfaceParams = toList.call$1(this.typeParameters); |
| 12253 var defaultParams = toList(typeDef.defaultType.typeParameters); | 12206 var defaultParams = toList.call$1(typeDef.defaultType.typeParameters); |
| 12254 var classParams = toList(this.defaultType.typeParameters); | 12207 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())) { | 12208 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()); | 12209 $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; | 12210 return; |
| 12258 } | 12211 } |
| 12259 for (var i = (0); | 12212 for (var i = (0); |
| 12260 i < interfaceParams.get$length(); i++) { | 12213 i < interfaceParams.get$length(); i++) { |
| 12261 var ip = interfaceParams.$index(i); | 12214 var ip = interfaceParams.$index(i); |
| 12262 var dp = defaultParams.$index(i); | 12215 var dp = defaultParams.$index(i); |
| 12263 var cp = classParams.$index(i); | 12216 var cp = classParams.$index(i); |
| 12264 dp.resolve$0(); | 12217 dp.resolve$0(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 12287 } | 12240 } |
| 12288 var typeDef = this.definition; | 12241 var typeDef = this.definition; |
| 12289 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, native_,
body, span); | 12242 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, native_,
body, span); |
| 12290 this.addMethod(null, c); | 12243 this.addMethod(null, c); |
| 12291 this.constructors.$index("").resolve$0(); | 12244 this.constructors.$index("").resolve$0(); |
| 12292 return this.constructors.$index(""); | 12245 return this.constructors.$index(""); |
| 12293 } | 12246 } |
| 12294 return null; | 12247 return null; |
| 12295 } | 12248 } |
| 12296 DefinedType.prototype.getMember = function(memberName) { | 12249 DefinedType.prototype.getMember = function(memberName) { |
| 12297 var member = this.members.$index(memberName); | 12250 var member = this._foundMembers.$index(memberName); |
| 12251 if (member != null) return member; |
| 12252 member = this.members.$index(memberName); |
| 12298 if (member != null) { | 12253 if (member != null) { |
| 12299 this._checkOverride(member); | 12254 this._checkOverride(member); |
| 12255 this._foundMembers.$setindex(memberName, member); |
| 12300 return member; | 12256 return member; |
| 12301 } | 12257 } |
| 12302 if (this.get$isTop()) { | 12258 if (this.get$isTop()) { |
| 12303 var libType = this.library.findTypeByName(memberName); | 12259 var libType = this.library.findTypeByName(memberName); |
| 12304 if (libType != null) { | 12260 if (libType != null) { |
| 12305 return libType.get$typeMember(); | 12261 member = libType.get$typeMember(); |
| 12262 this._foundMembers.$setindex(memberName, member); |
| 12263 return member; |
| 12306 } | 12264 } |
| 12307 } | 12265 } |
| 12308 return this._getMemberInParents(memberName); | 12266 member = this._getMemberInParents(memberName); |
| 12267 this._foundMembers.$setindex(memberName, member); |
| 12268 return member; |
| 12309 } | 12269 } |
| 12310 DefinedType.prototype.resolveTypeParams = function(inType) { | 12270 DefinedType.prototype.resolveTypeParams = function(inType) { |
| 12311 return this; | 12271 return this; |
| 12312 } | 12272 } |
| 12313 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { | 12273 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 12314 var jsnames = []; | 12274 var jsnames = []; |
| 12315 var names = []; | 12275 var names = []; |
| 12316 var typeMap = new HashMapImplementation(); | 12276 var typeMap = new HashMapImplementation(); |
| 12317 for (var i = (0); | 12277 for (var i = (0); |
| 12318 i < typeArgs.get$length(); i++) { | 12278 i < typeArgs.get$length(); i++) { |
| 12319 var paramName = this.typeParameters.$index(i).get$name(); | 12279 var paramName = this.typeParameters[i].get$name(); |
| 12320 typeMap.$setindex(paramName, typeArgs.$index(i)); | 12280 typeMap.$setindex(paramName, typeArgs[i]); |
| 12321 names.add$1(typeArgs.$index(i).get$name()); | 12281 names.add$1(typeArgs[i].get$name()); |
| 12322 jsnames.add$1(typeArgs.$index(i).get$jsname()); | 12282 jsnames.add$1(typeArgs[i].get$jsname()); |
| 12323 } | 12283 } |
| 12324 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$")); | 12284 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$")); |
| 12325 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">"); | 12285 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">"); |
| 12326 var key = Strings.join(names, "$"); | 12286 var key = Strings.join(names, "$"); |
| 12327 var ret = this._concreteTypes.$index(key); | 12287 var ret = this._concreteTypes.$index(key); |
| 12328 if (ret == null) { | 12288 if (ret == null) { |
| 12329 ret = new ConcreteType(simpleName, this, typeMap, typeArgs); | 12289 ret = new ConcreteType(simpleName, this, typeMap, typeArgs); |
| 12330 ret.set$_jsname(jsname); | 12290 ret.set$_jsname(jsname); |
| 12331 this._concreteTypes.$setindex(key, ret); | 12291 this._concreteTypes.$setindex(key, ret); |
| 12332 } | 12292 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12395 } | 12355 } |
| 12396 FixedCollection.prototype.every = function(f) { | 12356 FixedCollection.prototype.every = function(f) { |
| 12397 return Collections.every(this, f); | 12357 return Collections.every(this, f); |
| 12398 } | 12358 } |
| 12399 FixedCollection.prototype.some = function(f) { | 12359 FixedCollection.prototype.some = function(f) { |
| 12400 return Collections.some(this, f); | 12360 return Collections.some(this, f); |
| 12401 } | 12361 } |
| 12402 FixedCollection.prototype.isEmpty = function() { | 12362 FixedCollection.prototype.isEmpty = function() { |
| 12403 return this.length == (0); | 12363 return this.length == (0); |
| 12404 } | 12364 } |
| 12405 FixedCollection.prototype.every$1 = function($0) { | |
| 12406 return this.every(to$call$1($0)); | |
| 12407 }; | |
| 12408 FixedCollection.prototype.filter$1 = function($0) { | 12365 FixedCollection.prototype.filter$1 = function($0) { |
| 12409 return this.filter(to$call$1($0)); | 12366 return this.filter(to$call$1($0)); |
| 12410 }; | 12367 }; |
| 12411 FixedCollection.prototype.forEach$1 = function($0) { | 12368 FixedCollection.prototype.forEach$1 = function($0) { |
| 12412 return this.forEach(to$call$1($0)); | 12369 return this.forEach(to$call$1($0)); |
| 12413 }; | 12370 }; |
| 12414 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; | 12371 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; |
| 12415 FixedCollection.prototype.iterator$0 = FixedCollection.prototype.iterator; | 12372 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 ************** | 12373 // ********** Code for FixedCollection_Type ************** |
| 12420 $inherits(FixedCollection_Type, FixedCollection); | 12374 $inherits(FixedCollection_Type, FixedCollection); |
| 12421 function FixedCollection_Type(value, length) { | 12375 function FixedCollection_Type(value, length) { |
| 12422 this.value = value; | 12376 this.value = value; |
| 12423 this.length = length; | 12377 this.length = length; |
| 12424 } | 12378 } |
| 12425 // ********** Code for FixedIterator ************** | 12379 // ********** Code for FixedIterator ************** |
| 12426 function FixedIterator(value, length) { | 12380 function FixedIterator(value, length) { |
| 12427 this.length = length; | 12381 this.length = length; |
| 12428 this._index = (0); | 12382 this._index = (0); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12535 CopyOnWriteMap.prototype.containsKey = function(key) { | 12489 CopyOnWriteMap.prototype.containsKey = function(key) { |
| 12536 return this._lang_map.containsKey(key); | 12490 return this._lang_map.containsKey(key); |
| 12537 } | 12491 } |
| 12538 CopyOnWriteMap.prototype.containsKey$1 = CopyOnWriteMap.prototype.containsKey; | 12492 CopyOnWriteMap.prototype.containsKey$1 = CopyOnWriteMap.prototype.containsKey; |
| 12539 CopyOnWriteMap.prototype.forEach$1 = function($0) { | 12493 CopyOnWriteMap.prototype.forEach$1 = function($0) { |
| 12540 return this.forEach(to$call$2($0)); | 12494 return this.forEach(to$call$2($0)); |
| 12541 }; | 12495 }; |
| 12542 CopyOnWriteMap.prototype.getKeys$0 = CopyOnWriteMap.prototype.getKeys; | 12496 CopyOnWriteMap.prototype.getKeys$0 = CopyOnWriteMap.prototype.getKeys; |
| 12543 CopyOnWriteMap.prototype.getValues$0 = CopyOnWriteMap.prototype.getValues; | 12497 CopyOnWriteMap.prototype.getValues$0 = CopyOnWriteMap.prototype.getValues; |
| 12544 CopyOnWriteMap.prototype.isEmpty$0 = CopyOnWriteMap.prototype.isEmpty; | 12498 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 ************** | 12499 // ********** Code for CopyOnWriteMap_K$V ************** |
| 12549 $inherits(CopyOnWriteMap_K$V, CopyOnWriteMap); | 12500 $inherits(CopyOnWriteMap_K$V, CopyOnWriteMap); |
| 12550 function CopyOnWriteMap_K$V() {} | 12501 function CopyOnWriteMap_K$V() {} |
| 12551 CopyOnWriteMap_K$V._wrap$ctor = function(_map) { | 12502 CopyOnWriteMap_K$V._wrap$ctor = function(_map) { |
| 12552 this._lang_map = _map; | 12503 this._lang_map = _map; |
| 12553 } | 12504 } |
| 12554 CopyOnWriteMap_K$V._wrap$ctor.prototype = CopyOnWriteMap_K$V.prototype; | 12505 CopyOnWriteMap_K$V._wrap$ctor.prototype = CopyOnWriteMap_K$V.prototype; |
| 12555 // ********** Code for CopyOnWriteMap_dart_core_String$VariableValue ***********
*** | 12506 // ********** Code for CopyOnWriteMap_dart_core_String$VariableValue ***********
*** |
| 12556 $inherits(CopyOnWriteMap_dart_core_String$VariableValue, CopyOnWriteMap); | 12507 $inherits(CopyOnWriteMap_dart_core_String$VariableValue, CopyOnWriteMap); |
| 12557 function CopyOnWriteMap_dart_core_String$VariableValue() { | 12508 function CopyOnWriteMap_dart_core_String$VariableValue() { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12605 } | 12556 } |
| 12606 Value.prototype.get$isFinal = function() { | 12557 Value.prototype.get$isFinal = function() { |
| 12607 return false; | 12558 return false; |
| 12608 } | 12559 } |
| 12609 Value.prototype.get$needsTemp = function() { | 12560 Value.prototype.get$needsTemp = function() { |
| 12610 return true; | 12561 return true; |
| 12611 } | 12562 } |
| 12612 Value.prototype.get$staticType = function() { | 12563 Value.prototype.get$staticType = function() { |
| 12613 return this.get$type(); | 12564 return this.get$type(); |
| 12614 } | 12565 } |
| 12566 Value.comma = function(x, y) { |
| 12567 return new Value(y.get$type(), ("(" + x.get$code() + ", " + y.get$code() + ")"
), null); |
| 12568 } |
| 12615 Value.union = function(x, y) { | 12569 Value.union = function(x, y) { |
| 12616 if (y == null || $eq(x, y)) return x; | 12570 if (y == null || $eq(x, y)) return x; |
| 12617 if (x == null) return y; | 12571 if (x == null) return y; |
| 12618 var ret = x._tryUnion(y); | 12572 var ret = x._tryUnion(y); |
| 12619 if (ret != null) return ret; | 12573 if (ret != null) return ret; |
| 12620 ret = y._tryUnion(x); | 12574 ret = y._tryUnion(x); |
| 12621 if (ret != null) return ret; | 12575 if (ret != null) return ret; |
| 12622 return new Value(Type.union(x.get$type(), y.get$type()), null, null); | 12576 return new Value(Type.union(x.get$type(), y.get$type()), null, null); |
| 12623 } | 12577 } |
| 12624 Value.prototype._tryUnion = function(right) { | 12578 Value.prototype._tryUnion = function(right) { |
| 12625 return null; | 12579 return null; |
| 12626 } | 12580 } |
| 12627 Value.prototype.validateInitialized = function(span) { | 12581 Value.prototype.validateInitialized = function(span) { |
| 12628 | 12582 |
| 12629 } | 12583 } |
| 12630 Value.prototype.get_ = function(context, name, node) { | 12584 Value.prototype.get_ = function(context, name, node) { |
| 12631 var member = this._resolveMember(context, name, node, false); | 12585 var member = this._resolveMember(context, name, node, false); |
| 12632 if (member != null) { | 12586 if (member != null) { |
| 12633 return member._get$3(context, node, this); | 12587 return member._get$3(context, node, this); |
| 12634 } | 12588 } |
| 12635 else { | 12589 else { |
| 12636 return this.invokeNoSuchMethod(context, ("get:" + name), node); | 12590 return this.invokeNoSuchMethod(context, ("get:" + name), node); |
| 12637 } | 12591 } |
| 12638 } | 12592 } |
| 12639 Value.prototype.set_ = function(context, name, node, value, isDynamic) { | 12593 Value.prototype.set_ = function(context, name, node, value, isDynamic, kind, ret
urnKind) { |
| 12640 var member = this._resolveMember(context, name, node, isDynamic); | 12594 var member = this._resolveMember(context, name, node, isDynamic); |
| 12641 if (member != null) { | 12595 if (member != null) { |
| 12642 return member._set$5(context, node, this, value, isDynamic); | 12596 var thisValue = this; |
| 12597 var thisTmp = null; |
| 12598 var retTmp = null; |
| 12599 if (kind != (0)) { |
| 12600 thisTmp = context.getTemp(thisValue); |
| 12601 thisValue = context.assignTemp(thisTmp, thisValue); |
| 12602 var lhs = member._get$3(context, node, thisTmp); |
| 12603 if (returnKind == (3)) { |
| 12604 retTmp = context.forceTemp(lhs); |
| 12605 lhs = context.assignTemp(retTmp, lhs); |
| 12606 } |
| 12607 value = lhs.binop$4(kind, value, context, node); |
| 12608 } |
| 12609 if (returnKind == (2)) { |
| 12610 retTmp = context.forceTemp(value); |
| 12611 value = context.assignTemp(retTmp, value); |
| 12612 } |
| 12613 var ret = member._set$5(context, node, thisValue, value, isDynamic); |
| 12614 if (thisTmp != null && $ne(thisTmp, this)) context.freeTemp(thisTmp); |
| 12615 if (retTmp != null) { |
| 12616 context.freeTemp(retTmp); |
| 12617 return Value.comma(ret, retTmp); |
| 12618 } |
| 12619 else { |
| 12620 return ret; |
| 12621 } |
| 12643 } | 12622 } |
| 12644 else { | 12623 else { |
| 12645 return this.invokeNoSuchMethod(context, ("set:" + name), node, new Arguments
(null, [value])); | 12624 return this.invokeNoSuchMethod(context, ("set:" + name), node, new Arguments
(null, [value])); |
| 12646 } | 12625 } |
| 12647 } | 12626 } |
| 12627 Value.prototype.setIndex = function(context, index, node, value, isDynamic, kind
, returnKind) { |
| 12628 var member = this._resolveMember(context, ":setindex", node, isDynamic); |
| 12629 if (member != null) { |
| 12630 var thisValue = this; |
| 12631 var indexValue = index; |
| 12632 var thisTmp = null; |
| 12633 var indexTmp = null; |
| 12634 var retTmp = null; |
| 12635 if (returnKind == (2)) { |
| 12636 retTmp = context.forceTemp(value); |
| 12637 } |
| 12638 if (kind != (0)) { |
| 12639 thisTmp = context.getTemp(this); |
| 12640 indexTmp = context.getTemp(index); |
| 12641 thisValue = context.assignTemp(thisTmp, thisValue); |
| 12642 indexValue = context.assignTemp(indexTmp, indexValue); |
| 12643 if (returnKind == (3)) { |
| 12644 retTmp = context.forceTemp(value); |
| 12645 } |
| 12646 var lhs = thisTmp.invoke$4(context, ":index", node, new Arguments(null, [i
ndexTmp])); |
| 12647 if (returnKind == (3)) { |
| 12648 lhs = context.assignTemp(retTmp, lhs); |
| 12649 } |
| 12650 value = lhs.binop$4(kind, value, context, node); |
| 12651 } |
| 12652 if (returnKind == (2)) { |
| 12653 value = context.assignTemp(retTmp, value); |
| 12654 } |
| 12655 var ret = member.invoke$5(context, node, thisValue, new Arguments(null, [ind
exValue, value]), isDynamic); |
| 12656 if (thisTmp != null && $ne(thisTmp, this)) context.freeTemp(thisTmp); |
| 12657 if (indexTmp != null && $ne(indexTmp, index)) context.freeTemp(indexTmp); |
| 12658 if (retTmp != null) { |
| 12659 context.freeTemp(retTmp); |
| 12660 return Value.comma(ret, retTmp); |
| 12661 } |
| 12662 else { |
| 12663 return ret; |
| 12664 } |
| 12665 } |
| 12666 else { |
| 12667 return this.invokeNoSuchMethod(context, ":index", node, new Arguments(null,
[index, value])); |
| 12668 } |
| 12669 } |
| 12648 Value.prototype.unop = function(kind, context, node) { | 12670 Value.prototype.unop = function(kind, context, node) { |
| 12649 switch (kind) { | 12671 switch (kind) { |
| 12650 case (19): | 12672 case (19): |
| 12651 | 12673 |
| 12652 var newVal = this.convertTo(context, $globals.world.nonNullBool, false); | 12674 var newVal = this.convertTo(context, $globals.world.nonNullBool, false); |
| 12653 return new Value(newVal.get$type(), ("!" + newVal.get$code()), node.get$sp
an()); | 12675 return new Value(newVal.get$type(), ("!" + newVal.get$code()), node.get$sp
an()); |
| 12654 | 12676 |
| 12655 case (42): | 12677 case (42): |
| 12656 | 12678 |
| 12657 $globals.world.error("no unary add operator in dart", node.get$span()); | 12679 $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 } | 12728 } |
| 12707 } | 12729 } |
| 12708 Value.prototype.canInvoke = function(context, name, args) { | 12730 Value.prototype.canInvoke = function(context, name, args) { |
| 12709 if (this.get$type().get$isVarOrFunction() && name == ":call") { | 12731 if (this.get$type().get$isVarOrFunction() && name == ":call") { |
| 12710 return true; | 12732 return true; |
| 12711 } | 12733 } |
| 12712 var member = this._resolveMember(context, name, null, true); | 12734 var member = this._resolveMember(context, name, null, true); |
| 12713 return member != null && member.canInvoke$2(context, args); | 12735 return member != null && member.canInvoke$2(context, args); |
| 12714 } | 12736 } |
| 12715 Value.prototype._hasOverriddenNoSuchMethod = function() { | 12737 Value.prototype._hasOverriddenNoSuchMethod = function() { |
| 12716 if (this.get$isSuper()) { | 12738 var m = this.get$type().getMember("noSuchMethod"); |
| 12717 var m = this.get$staticType().getMember("noSuchMethod"); | 12739 return m != null && !m.get$declaringType().get$isObject(); |
| 12718 return m != null && !m.get$declaringType().get$isObject(); | 12740 } |
| 12741 Value.prototype.get$isPreciseType = function() { |
| 12742 return this.get$isSuper() || this.get$isType(); |
| 12743 } |
| 12744 Value.prototype._missingMemberError = function(context, name, isDynamic, node) { |
| 12745 var onStaticType = false; |
| 12746 if ($ne(this.get$type(), this.get$staticType())) { |
| 12747 onStaticType = this.get$staticType().getMember(name) != null; |
| 12748 } |
| 12749 if (!onStaticType && !isDynamic && !this._isVarOrParameterType(this.get$static
Type()) && !this._hasOverriddenNoSuchMethod()) { |
| 12750 var typeName = this.get$staticType().name; |
| 12751 if (typeName == null) typeName = this.get$staticType().get$library().name; |
| 12752 var message = ("can not resolve \"" + name + "\" on \"" + typeName + "\""); |
| 12753 if (this.get$isType()) { |
| 12754 $globals.world.error(message, node.span); |
| 12755 } |
| 12756 else { |
| 12757 $globals.world.warning(message, node.span); |
| 12758 } |
| 12759 } |
| 12760 } |
| 12761 Value.prototype._tryResolveMember = function(context, name, isDynamic, node) { |
| 12762 var member = this.get$type().getMember(name); |
| 12763 if (member == null) { |
| 12764 this._missingMemberError(context, name, isDynamic, node); |
| 12765 return null; |
| 12719 } | 12766 } |
| 12720 else { | 12767 else { |
| 12721 var m = this.get$staticType().resolveMember("noSuchMethod"); | 12768 if (this.get$isType() && !member.get$isStatic()) { |
| 12722 return m != null && m.get$members().get$length() > (1); | 12769 if (!isDynamic) { |
| 12770 $globals.world.error("can not refer to instance member as static", node.
span); |
| 12771 } |
| 12772 return null; |
| 12773 } |
| 12723 } | 12774 } |
| 12724 } | 12775 if (this.get$isPreciseType() || member.get$isStatic()) { |
| 12725 Value.prototype._tryResolveMember = function(context, resolvetype, name) { | 12776 return member.get$preciseMemberSet(); |
| 12726 if (this.get$isSuper()) { | |
| 12727 return resolvetype.getMember(name); | |
| 12728 } | 12777 } |
| 12729 else { | 12778 else { |
| 12730 return resolvetype.resolveMember(name); | 12779 return member.get$potentialMemberSet(); |
| 12731 } | 12780 } |
| 12732 } | 12781 } |
| 12733 Value.prototype._isVarOrParameterType = function(t) { | 12782 Value.prototype._isVarOrParameterType = function(t) { |
| 12734 return t.get$isVar() || (t instanceof ParameterType); | 12783 return t.get$isVar() || (t instanceof ParameterType); |
| 12735 } | 12784 } |
| 12736 Value.prototype._shouldBindDynamically = function() { | 12785 Value.prototype._shouldBindDynamically = function() { |
| 12737 return this._isVarOrParameterType(this.get$type()) || $globals.options.forceDy
namic && !this.get$isConst(); | 12786 return this._isVarOrParameterType(this.get$type()) || $globals.options.forceDy
namic && !this.get$isConst(); |
| 12738 } | 12787 } |
| 12739 Value.prototype._resolveMember = function(context, name, node, isDynamic) { | 12788 Value.prototype._resolveMember = function(context, name, node, isDynamic) { |
| 12740 var member; | 12789 var member = null; |
| 12741 if (!this._shouldBindDynamically()) { | 12790 if (!this._shouldBindDynamically()) { |
| 12742 member = this._tryResolveMember(context, this.get$type(), name); | 12791 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 } | 12792 } |
| 12764 if (member == null && !this.get$isSuper() && !this.get$isType()) { | 12793 if (member == null && !this.get$isSuper() && !this.get$isType()) { |
| 12765 member = context.findMembers(name); | 12794 member = context.findMembers(name); |
| 12766 if (member == null && !isDynamic) { | 12795 if (member == null && !isDynamic) { |
| 12767 var where = "the world"; | 12796 var where = "the world"; |
| 12768 if (name.startsWith("_")) { | 12797 if (name.startsWith("_")) { |
| 12769 where = ("library \"" + context.get$library().name + "\""); | 12798 where = ("library \"" + context.get$library().name + "\""); |
| 12770 } | 12799 } |
| 12771 $globals.world.warning(("" + name + " is not defined anywhere in " + where
+ "."), node.span); | 12800 $globals.world.warning(("" + name + " is not defined anywhere in " + where
+ "."), node.span); |
| 12772 } | 12801 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12855 $globals.world.gen.corejs.useThrow = true; | 12884 $globals.world.gen.corejs.useThrow = true; |
| 12856 return ("$throw(" + result.get$code() + ")"); | 12885 return ("$throw(" + result.get$code() + ")"); |
| 12857 }) | 12886 }) |
| 12858 ); | 12887 ); |
| 12859 } | 12888 } |
| 12860 if (toType.get$isNum()) toType = $globals.world.numType; | 12889 if (toType.get$isNum()) toType = $globals.world.numType; |
| 12861 var check; | 12890 var check; |
| 12862 if (toType.get$isVoid()) { | 12891 if (toType.get$isVoid()) { |
| 12863 check = ("$assert_void(" + this.get$code() + ")"); | 12892 check = ("$assert_void(" + this.get$code() + ")"); |
| 12864 if (toType.typeCheckCode == null) { | 12893 if (toType.typeCheckCode == null) { |
| 12865 toType.typeCheckCode = ("function $assert_void(x) {\n if (x == null) retu
rn null;\n " + throwTypeError("x") + "\n}"); | 12894 toType.typeCheckCode = ("function $assert_void(x) {\n if (x == null) retu
rn null;\n " + throwTypeError.call$1("x") + "\n}"); |
| 12866 } | 12895 } |
| 12867 } | 12896 } |
| 12868 else if ($eq(toType, $globals.world.nonNullBool)) { | 12897 else if ($eq(toType, $globals.world.nonNullBool)) { |
| 12869 $globals.world.gen.corejs.useNotNullBool = true; | 12898 $globals.world.gen.corejs.useNotNullBool = true; |
| 12870 check = ("$notnull_bool(" + this.get$code() + ")"); | 12899 check = ("$notnull_bool(" + this.get$code() + ")"); |
| 12871 } | 12900 } |
| 12872 else if (toType.get$library().get$isCore() && toType.get$typeofName() != null)
{ | 12901 else if (toType.get$library().get$isCore() && toType.get$typeofName() != null)
{ |
| 12873 check = ("$assert_" + toType.name + "(" + this.get$code() + ")"); | 12902 check = ("$assert_" + toType.name + "(" + this.get$code() + ")"); |
| 12874 if (toType.typeCheckCode == null) { | 12903 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}"); | 12904 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 } | 12905 } |
| 12877 } | 12906 } |
| 12878 else { | 12907 else { |
| 12879 toType.isChecked = true; | 12908 toType.isChecked = true; |
| 12880 var checkName = "assert$" + toType.get$jsname(); | 12909 var checkName = "assert$" + toType.get$jsname(); |
| 12881 var temp = context.getTemp(this); | 12910 var temp = context.getTemp(this); |
| 12882 check = ("(" + context.assignTemp(temp, this).get$code() + " == null ? null
:"); | 12911 check = ("(" + context.assignTemp(temp, this).get$code() + " == null ? null
:"); |
| 12883 check = check + (" " + temp.get$code() + "." + checkName + "())"); | 12912 check = check + (" " + temp.get$code() + "." + checkName + "())"); |
| 12884 if ($ne(this, temp)) context.freeTemp(temp); | 12913 if ($ne(this, temp)) context.freeTemp(temp); |
| 12885 $globals.world.objectType.varStubs.putIfAbsent$2(checkName, (function () { | 12914 $globals.world.objectType.varStubs.putIfAbsent(checkName, (function () { |
| 12886 return new VarMethodStub(checkName, null, Arguments.get$EMPTY(), throwType
Error("this")); | 12915 return new VarMethodStub(checkName, null, Arguments.get$EMPTY(), throwType
Error.call$1("this")); |
| 12887 }) | 12916 }) |
| 12888 ); | 12917 ); |
| 12889 } | 12918 } |
| 12890 context.counters.typeAsserts++; | 12919 context.counters.typeAsserts++; |
| 12891 return new Value(toType, check, this.span); | 12920 return new Value(toType, check, this.span); |
| 12892 } | 12921 } |
| 12893 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck)
{ | 12922 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck)
{ |
| 12894 if (toType.get$isVar()) { | 12923 if (toType.get$isVar()) { |
| 12895 $globals.world.error("can not resolve type", span); | 12924 $globals.world.error("can not resolve type", span); |
| 12896 } | 12925 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12932 if (!$globals.world.objectType.varStubs.containsKey(checkName)) { | 12961 if (!$globals.world.objectType.varStubs.containsKey(checkName)) { |
| 12933 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub(
checkName, null, Arguments.get$EMPTY(), "return false")); | 12962 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub(
checkName, null, Arguments.get$EMPTY(), "return false")); |
| 12934 } | 12963 } |
| 12935 } | 12964 } |
| 12936 return new Value($globals.world.nonNullBool, testCode, span); | 12965 return new Value($globals.world.nonNullBool, testCode, span); |
| 12937 } | 12966 } |
| 12938 Value.prototype.convertWarning = function(toType) { | 12967 Value.prototype.convertWarning = function(toType) { |
| 12939 $globals.world.warning(("type \"" + this.get$type().name + "\" is not assignab
le to \"" + toType.name + "\""), this.span); | 12968 $globals.world.warning(("type \"" + this.get$type().name + "\" is not assignab
le to \"" + toType.name + "\""), this.span); |
| 12940 } | 12969 } |
| 12941 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { | 12970 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { |
| 12971 if (this.get$isType()) { |
| 12972 $globals.world.error(("member lookup failed for \"" + name + "\""), node.spa
n); |
| 12973 } |
| 12942 var pos = ""; | 12974 var pos = ""; |
| 12943 if (args != null) { | 12975 if (args != null) { |
| 12944 var argsCode = []; | 12976 var argsCode = []; |
| 12945 for (var i = (0); | 12977 for (var i = (0); |
| 12946 i < args.get$length(); i++) { | 12978 i < args.get$length(); i++) { |
| 12947 argsCode.add$1(args.values.$index(i).get$code()); | 12979 argsCode.add$1(args.values[i].get$code()); |
| 12948 } | 12980 } |
| 12949 pos = Strings.join(argsCode, ", "); | 12981 pos = Strings.join(argsCode, ", "); |
| 12950 } | 12982 } |
| 12951 var noSuchArgs = [new Value($globals.world.stringType, ("\"" + name + "\""), n
ode.span), new Value($globals.world.listType, ("[" + pos + "]"), node.span)]; | 12983 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)); | 12984 return this._resolveMember(context, "noSuchMethod", node, false).invoke(contex
t, node, this, new Arguments(null, noSuchArgs), false); |
| 12953 } | 12985 } |
| 12954 Value.fromBool = function(value, span) { | 12986 Value.fromBool = function(value, span) { |
| 12955 return new BoolValue(value, true, span); | 12987 return new BoolValue(value, true, span); |
| 12956 } | 12988 } |
| 12957 Value.fromInt = function(value, span) { | 12989 Value.fromInt = function(value, span) { |
| 12958 return new IntValue(value, true, span); | 12990 return new IntValue(value, true, span); |
| 12959 } | 12991 } |
| 12960 Value.fromDouble = function(value, span) { | 12992 Value.fromDouble = function(value, span) { |
| 12961 return new DoubleValue(value, true, span); | 12993 return new DoubleValue(value, true, span); |
| 12962 } | 12994 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 12977 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { | 13009 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { |
| 12978 return this.instanceOf($0, $1, $2, $3, false); | 13010 return this.instanceOf($0, $1, $2, $3, false); |
| 12979 }; | 13011 }; |
| 12980 Value.prototype.invoke$4 = function($0, $1, $2, $3) { | 13012 Value.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 12981 return this.invoke($0, $1, $2, $3, false); | 13013 return this.invoke($0, $1, $2, $3, false); |
| 12982 }; | 13014 }; |
| 12983 Value.prototype.invoke$4$isDynamic = Value.prototype.invoke; | 13015 Value.prototype.invoke$4$isDynamic = Value.prototype.invoke; |
| 12984 Value.prototype.invoke$5 = Value.prototype.invoke; | 13016 Value.prototype.invoke$5 = Value.prototype.invoke; |
| 12985 Value.prototype.invokeNoSuchMethod$4 = Value.prototype.invokeNoSuchMethod; | 13017 Value.prototype.invokeNoSuchMethod$4 = Value.prototype.invokeNoSuchMethod; |
| 12986 Value.prototype.needsConversion$1 = Value.prototype.needsConversion; | 13018 Value.prototype.needsConversion$1 = Value.prototype.needsConversion; |
| 12987 Value.prototype.set_$4 = function($0, $1, $2, $3) { | 13019 Value.prototype.setIndex$4$kind$returnKind = function($0, $1, $2, $3, kind, retu
rnKind) { |
| 12988 return this.set_($0, $1, $2, $3, false); | 13020 return this.setIndex($0, $1, $2, $3, false, kind, returnKind); |
| 13021 }; |
| 13022 Value.prototype.set_$4$kind$returnKind = function($0, $1, $2, $3, kind, returnKi
nd) { |
| 13023 return this.set_($0, $1, $2, $3, false, kind, returnKind); |
| 12989 }; | 13024 }; |
| 12990 Value.prototype.unop$3 = Value.prototype.unop; | 13025 Value.prototype.unop$3 = Value.prototype.unop; |
| 12991 // ********** Code for EvaluatedValue ************** | 13026 // ********** Code for EvaluatedValue ************** |
| 12992 $inherits(EvaluatedValue, Value); | 13027 $inherits(EvaluatedValue, Value); |
| 12993 function EvaluatedValue(isConst, type, span) { | 13028 function EvaluatedValue(isConst, type, span) { |
| 12994 this.isConst = isConst; | 13029 this.isConst = isConst; |
| 12995 Value.call(this, type, "@@@", span); | 13030 Value.call(this, type, "@@@", span); |
| 12996 } | 13031 } |
| 12997 EvaluatedValue.prototype.get$isConst = function() { return this.isConst; }; | 13032 EvaluatedValue.prototype.get$isConst = function() { return this.isConst; }; |
| 12998 EvaluatedValue.prototype.get$code = function() { | 13033 EvaluatedValue.prototype.get$code = function() { |
| 12999 $globals.world.internalError("Should not be getting code from raw EvaluatedVal
ue", this.span); | 13034 $globals.world.internalError("Should not be getting code from raw EvaluatedVal
ue", this.span); |
| 13000 } | 13035 } |
| 13001 EvaluatedValue.prototype.get$needsTemp = function() { | 13036 EvaluatedValue.prototype.get$needsTemp = function() { |
| 13002 return false; | 13037 return false; |
| 13003 } | 13038 } |
| 13004 EvaluatedValue.prototype.hashCode = function() { | 13039 EvaluatedValue.prototype.hashCode = function() { |
| 13005 return this.get$code().hashCode(); | 13040 return this.get$code().hashCode(); |
| 13006 } | 13041 } |
| 13007 EvaluatedValue.prototype.$eq = function(other) { | 13042 EvaluatedValue.prototype.$eq = function(other) { |
| 13008 return (other instanceof EvaluatedValue) && $eq(other.get$type(), this.type) &
& $eq(other.get$code(), this.get$code()); | 13043 return (other instanceof EvaluatedValue) && $eq(other.get$type(), this.get$typ
e()) && $eq(other.get$code(), this.get$code()); |
| 13009 } | 13044 } |
| 13010 EvaluatedValue.prototype.hashCode$0 = EvaluatedValue.prototype.hashCode; | 13045 EvaluatedValue.prototype.hashCode$0 = EvaluatedValue.prototype.hashCode; |
| 13011 // ********** Code for NullValue ************** | 13046 // ********** Code for NullValue ************** |
| 13012 $inherits(NullValue, EvaluatedValue); | 13047 $inherits(NullValue, EvaluatedValue); |
| 13013 function NullValue(isConst, span) { | 13048 function NullValue(isConst, span) { |
| 13014 EvaluatedValue.call(this, isConst, $globals.world.varType, span); | 13049 EvaluatedValue.call(this, isConst, $globals.world.varType, span); |
| 13015 } | 13050 } |
| 13016 NullValue.prototype.get$actualValue = function() { | 13051 NullValue.prototype.get$actualValue = function() { |
| 13017 return null; | 13052 return null; |
| 13018 } | 13053 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13145 case (39): | 13180 case (39): |
| 13146 | 13181 |
| 13147 return new IntValue(x << y, c, s); | 13182 return new IntValue(x << y, c, s); |
| 13148 | 13183 |
| 13149 case (40): | 13184 case (40): |
| 13150 | 13185 |
| 13151 return new IntValue(x >> y, c, s); | 13186 return new IntValue(x >> y, c, s); |
| 13152 | 13187 |
| 13153 case (42): | 13188 case (42): |
| 13154 | 13189 |
| 13155 return new IntValue(x + y, c, s); | 13190 return new IntValue($add(x, y), c, s); |
| 13156 | 13191 |
| 13157 case (43): | 13192 case (43): |
| 13158 | 13193 |
| 13159 return new IntValue(x - y, c, s); | 13194 return new IntValue(x - y, c, s); |
| 13160 | 13195 |
| 13161 case (44): | 13196 case (44): |
| 13162 | 13197 |
| 13163 return new IntValue(x * y, c, s); | 13198 return new IntValue(x * y, c, s); |
| 13164 | 13199 |
| 13165 case (45): | 13200 case (45): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13201 | 13236 |
| 13202 return new BoolValue(x == y, c, s); | 13237 return new BoolValue(x == y, c, s); |
| 13203 | 13238 |
| 13204 case (51): | 13239 case (51): |
| 13205 case (49): | 13240 case (49): |
| 13206 | 13241 |
| 13207 return new BoolValue(x != y, c, s); | 13242 return new BoolValue(x != y, c, s); |
| 13208 | 13243 |
| 13209 case (42): | 13244 case (42): |
| 13210 | 13245 |
| 13211 return new DoubleValue(x + y, c, s); | 13246 return new DoubleValue($add(x, y), c, s); |
| 13212 | 13247 |
| 13213 case (43): | 13248 case (43): |
| 13214 | 13249 |
| 13215 return new DoubleValue(x - y, c, s); | 13250 return new DoubleValue(x - y, c, s); |
| 13216 | 13251 |
| 13217 case (44): | 13252 case (44): |
| 13218 | 13253 |
| 13219 return new DoubleValue(x * y, c, s); | 13254 return new DoubleValue(x * y, c, s); |
| 13220 | 13255 |
| 13221 case (45): | 13256 case (45): |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13287 | 13322 |
| 13288 return new BoolValue(x == y, c, s); | 13323 return new BoolValue(x == y, c, s); |
| 13289 | 13324 |
| 13290 case (51): | 13325 case (51): |
| 13291 case (49): | 13326 case (49): |
| 13292 | 13327 |
| 13293 return new BoolValue(x != y, c, s); | 13328 return new BoolValue(x != y, c, s); |
| 13294 | 13329 |
| 13295 case (42): | 13330 case (42): |
| 13296 | 13331 |
| 13297 return new DoubleValue(x + y, c, s); | 13332 return new DoubleValue($add(x, y), c, s); |
| 13298 | 13333 |
| 13299 case (43): | 13334 case (43): |
| 13300 | 13335 |
| 13301 return new DoubleValue(x - y, c, s); | 13336 return new DoubleValue(x - y, c, s); |
| 13302 | 13337 |
| 13303 case (44): | 13338 case (44): |
| 13304 | 13339 |
| 13305 return new DoubleValue(x * y, c, s); | 13340 return new DoubleValue(x * y, c, s); |
| 13306 | 13341 |
| 13307 case (45): | 13342 case (45): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13343 | 13378 |
| 13344 return new BoolValue(x == y, c, s); | 13379 return new BoolValue(x == y, c, s); |
| 13345 | 13380 |
| 13346 case (51): | 13381 case (51): |
| 13347 case (49): | 13382 case (49): |
| 13348 | 13383 |
| 13349 return new BoolValue(x != y, c, s); | 13384 return new BoolValue(x != y, c, s); |
| 13350 | 13385 |
| 13351 case (42): | 13386 case (42): |
| 13352 | 13387 |
| 13353 return new DoubleValue(x + y, c, s); | 13388 return new DoubleValue($add(x, y), c, s); |
| 13354 | 13389 |
| 13355 case (43): | 13390 case (43): |
| 13356 | 13391 |
| 13357 return new DoubleValue(x - y, c, s); | 13392 return new DoubleValue(x - y, c, s); |
| 13358 | 13393 |
| 13359 case (44): | 13394 case (44): |
| 13360 | 13395 |
| 13361 return new DoubleValue(x * y, c, s); | 13396 return new DoubleValue(x * y, c, s); |
| 13362 | 13397 |
| 13363 case (45): | 13398 case (45): |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13508 function ListValue(values, isConst, type, span) { | 13543 function ListValue(values, isConst, type, span) { |
| 13509 this.values = values; | 13544 this.values = values; |
| 13510 EvaluatedValue.call(this, isConst, type, span); | 13545 EvaluatedValue.call(this, isConst, type, span); |
| 13511 } | 13546 } |
| 13512 ListValue.prototype.get$code = function() { | 13547 ListValue.prototype.get$code = function() { |
| 13513 var buf = new StringBufferImpl(""); | 13548 var buf = new StringBufferImpl(""); |
| 13514 buf.add$1("["); | 13549 buf.add$1("["); |
| 13515 for (var i = (0); | 13550 for (var i = (0); |
| 13516 i < this.values.get$length(); i = $add(i, (1))) { | 13551 i < this.values.get$length(); i = $add(i, (1))) { |
| 13517 if (i > (0)) buf.add$1(", "); | 13552 if (i > (0)) buf.add$1(", "); |
| 13518 buf.add$1(this.values.$index(i).get$code()); | 13553 buf.add$1(this.values[i].get$code()); |
| 13519 } | 13554 } |
| 13520 buf.add$1("]"); | 13555 buf.add$1("]"); |
| 13521 var listCode = buf.toString$0(); | 13556 var listCode = buf.toString$0(); |
| 13522 if (!this.isConst) return listCode; | 13557 if (!this.isConst) return listCode; |
| 13523 var v = new Value($globals.world.listType, listCode, this.span); | 13558 var v = new Value($globals.world.listType, listCode, this.span); |
| 13524 var immutableListCtor = $globals.world.immutableListType.getConstructor("from"
); | 13559 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])); | 13560 var result = immutableListCtor.invoke$4(null, null, new TypeValue(v.get$type()
, this.span), new Arguments(null, [v])); |
| 13526 return result.get$code(); | 13561 return result.get$code(); |
| 13527 } | 13562 } |
| 13528 ListValue.prototype.binop = function(kind, other, context, node) { | 13563 ListValue.prototype.binop = function(kind, other, context, node) { |
| 13529 if (!(other instanceof ListValue)) return Value.prototype.binop.call(this, kin
d, other, context, node); | 13564 if (!(other instanceof ListValue)) return Value.prototype.binop.call(this, kin
d, other, context, node); |
| 13530 switch (kind) { | 13565 switch (kind) { |
| 13531 case (50): | 13566 case (50): |
| 13532 | 13567 |
| 13533 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() =
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13568 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 | 13569 |
| 13535 case (51): | 13570 case (51): |
| 13536 | 13571 |
| 13537 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() !
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13572 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 | 13573 |
| 13539 } | 13574 } |
| 13540 return Value.prototype.binop.call(this, kind, other, context, node); | 13575 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13541 } | 13576 } |
| 13542 ListValue.prototype.getGlobalValue = function() { | 13577 ListValue.prototype.getGlobalValue = function() { |
| 13543 return $globals.world.gen.globalForConst(this, this.values); | 13578 return $globals.world.gen.globalForConst(this, this.values); |
| 13544 } | 13579 } |
| 13545 ListValue.prototype.binop$4 = ListValue.prototype.binop; | 13580 ListValue.prototype.binop$4 = ListValue.prototype.binop; |
| 13546 ListValue.prototype.getGlobalValue$0 = ListValue.prototype.getGlobalValue; | 13581 ListValue.prototype.getGlobalValue$0 = ListValue.prototype.getGlobalValue; |
| 13547 // ********** Code for MapValue ************** | 13582 // ********** Code for MapValue ************** |
| (...skipping 10 matching lines...) Expand all Loading... |
| 13558 return value.get$code(); | 13593 return value.get$code(); |
| 13559 } | 13594 } |
| 13560 MapValue.prototype.getGlobalValue = function() { | 13595 MapValue.prototype.getGlobalValue = function() { |
| 13561 return $globals.world.gen.globalForConst(this, this.values); | 13596 return $globals.world.gen.globalForConst(this, this.values); |
| 13562 } | 13597 } |
| 13563 MapValue.prototype.binop = function(kind, other, context, node) { | 13598 MapValue.prototype.binop = function(kind, other, context, node) { |
| 13564 if (!(other instanceof MapValue)) return Value.prototype.binop.call(this, kind
, other, context, node); | 13599 if (!(other instanceof MapValue)) return Value.prototype.binop.call(this, kind
, other, context, node); |
| 13565 switch (kind) { | 13600 switch (kind) { |
| 13566 case (50): | 13601 case (50): |
| 13567 | 13602 |
| 13568 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() =
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13603 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 | 13604 |
| 13570 case (51): | 13605 case (51): |
| 13571 | 13606 |
| 13572 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() !
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13607 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 | 13608 |
| 13574 } | 13609 } |
| 13575 return Value.prototype.binop.call(this, kind, other, context, node); | 13610 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13576 } | 13611 } |
| 13577 MapValue.prototype.binop$4 = MapValue.prototype.binop; | 13612 MapValue.prototype.binop$4 = MapValue.prototype.binop; |
| 13578 MapValue.prototype.getGlobalValue$0 = MapValue.prototype.getGlobalValue; | 13613 MapValue.prototype.getGlobalValue$0 = MapValue.prototype.getGlobalValue; |
| 13579 // ********** Code for ObjectValue ************** | 13614 // ********** Code for ObjectValue ************** |
| 13580 $inherits(ObjectValue, EvaluatedValue); | 13615 $inherits(ObjectValue, EvaluatedValue); |
| 13581 function ObjectValue(isConst, type, span) { | 13616 function ObjectValue(isConst, type, span) { |
| 13582 this.seenNativeInitializer = false; | 13617 this.seenNativeInitializer = false; |
| 13583 this.fields = new HashMapImplementation(); | 13618 this.fields = new HashMapImplementation(); |
| 13584 EvaluatedValue.call(this, isConst, type, span); | 13619 EvaluatedValue.call(this, isConst, type, span); |
| 13585 } | 13620 } |
| 13586 ObjectValue.prototype.get$fields = function() { return this.fields; }; | 13621 ObjectValue.prototype.get$fields = function() { return this.fields; }; |
| 13587 ObjectValue.prototype.get$seenNativeInitializer = function() { return this.seenN
ativeInitializer; }; | 13622 ObjectValue.prototype.get$seenNativeInitializer = function() { return this.seenN
ativeInitializer; }; |
| 13588 ObjectValue.prototype.set$seenNativeInitializer = function(value) { return this.
seenNativeInitializer = value; }; | 13623 ObjectValue.prototype.set$seenNativeInitializer = function(value) { return this.
seenNativeInitializer = value; }; |
| 13589 ObjectValue.prototype.get$code = function() { | 13624 ObjectValue.prototype.get$code = function() { |
| 13590 if (this._code == null) this.validateInitialized(null); | 13625 if (this._code == null) this.validateInitialized(null); |
| 13591 return this._code; | 13626 return this._code; |
| 13592 } | 13627 } |
| 13593 ObjectValue.prototype.initFields = function() { | 13628 ObjectValue.prototype.initFields = function() { |
| 13594 var allMembers = $globals.world.gen._orderValues(this.type.getAllMembers()); | 13629 var allMembers = $globals.world.gen._orderValues(this.get$type().getAllMembers
()); |
| 13595 for (var $$i = allMembers.iterator$0(); $$i.hasNext$0(); ) { | 13630 for (var $$i = allMembers.iterator$0(); $$i.hasNext$0(); ) { |
| 13596 var f = $$i.next$0(); | 13631 var f = $$i.next$0(); |
| 13597 if (f.get$isField() && !f.get$isStatic() && f.get$declaringType().get$isClas
s()) { | 13632 if (f.get$isField() && !f.get$isStatic() && f.get$declaringType().get$isClas
s()) { |
| 13598 this.fields.$setindex(f, f.computeValue$0()); | 13633 this.fields.$setindex(f, f.computeValue$0()); |
| 13599 } | 13634 } |
| 13600 } | 13635 } |
| 13601 } | 13636 } |
| 13602 ObjectValue.prototype.setField = function(field, value, duringInit) { | 13637 ObjectValue.prototype.setField = function(field, value, duringInit) { |
| 13603 if (value.get$isConst() && (value instanceof VariableValue)) { | 13638 if (value.get$isConst() && (value instanceof VariableValue)) { |
| 13604 value = value.get$dynamic().get$value(); | 13639 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()); | 13653 $globals.world.error("reassignment of field not allowed", value.span, fiel
d.get$span()); |
| 13619 } | 13654 } |
| 13620 else { | 13655 else { |
| 13621 this.fields.$setindex(field, value); | 13656 this.fields.$setindex(field, value); |
| 13622 } | 13657 } |
| 13623 } | 13658 } |
| 13624 } | 13659 } |
| 13625 ObjectValue.prototype.validateInitialized = function(span) { | 13660 ObjectValue.prototype.validateInitialized = function(span) { |
| 13626 var buf = new StringBufferImpl(""); | 13661 var buf = new StringBufferImpl(""); |
| 13627 buf.add$1("Object.create("); | 13662 buf.add$1("Object.create("); |
| 13628 buf.add$1(("" + this.type.get$jsname() + ".prototype, ")); | 13663 buf.add$1(("" + this.get$type().get$jsname() + ".prototype, ")); |
| 13629 buf.add$1("{"); | 13664 buf.add$1("{"); |
| 13630 var $$list = this.fields.getKeys$0(); | 13665 var $$list = this.fields.getKeys(); |
| 13631 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 13666 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 13632 var field = $$i.next$0(); | 13667 var field = $$i.next$0(); |
| 13633 buf.add$1(field.get$name()); | 13668 buf.add$1(field.get$name()); |
| 13634 buf.add$1(": "); | 13669 buf.add$1(": "); |
| 13635 buf.add$1("{\"value\": "); | 13670 buf.add$1("{\"value\": "); |
| 13636 if (this.fields.$index(field) == null) { | 13671 if (this.fields.$index(field) == null) { |
| 13637 $globals.world.error(("Required field \"" + field.get$name() + "\" was not
initialized"), span, field.get$span()); | 13672 $globals.world.error(("Required field \"" + field.get$name() + "\" was not
initialized"), span, field.get$span()); |
| 13638 buf.add$1("null"); | 13673 buf.add$1("null"); |
| 13639 } | 13674 } |
| 13640 else { | 13675 else { |
| 13641 buf.add$1(this.fields.$index(field).get$code()); | 13676 buf.add$1(this.fields.$index(field).get$code()); |
| 13642 } | 13677 } |
| 13643 buf.add$1(", writeable: false}, "); | 13678 buf.add$1(", writeable: false}, "); |
| 13644 } | 13679 } |
| 13645 buf.add$1("})"); | 13680 buf.add$1("})"); |
| 13646 this._code = buf.toString$0(); | 13681 this._code = buf.toString$0(); |
| 13647 } | 13682 } |
| 13648 ObjectValue.prototype.binop = function(kind, other, context, node) { | 13683 ObjectValue.prototype.binop = function(kind, other, context, node) { |
| 13649 if (!(other instanceof ObjectValue)) return Value.prototype.binop.call(this, k
ind, other, context, node); | 13684 if (!(other instanceof ObjectValue)) return Value.prototype.binop.call(this, k
ind, other, context, node); |
| 13650 switch (kind) { | 13685 switch (kind) { |
| 13651 case (50): | 13686 case (50): |
| 13652 case (48): | 13687 case (48): |
| 13653 | 13688 |
| 13654 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() =
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13689 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 | 13690 |
| 13656 case (51): | 13691 case (51): |
| 13657 case (49): | 13692 case (49): |
| 13658 | 13693 |
| 13659 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() !
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13694 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 | 13695 |
| 13661 } | 13696 } |
| 13662 return Value.prototype.binop.call(this, kind, other, context, node); | 13697 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13663 } | 13698 } |
| 13664 ObjectValue.prototype.binop$4 = ObjectValue.prototype.binop; | 13699 ObjectValue.prototype.binop$4 = ObjectValue.prototype.binop; |
| 13665 ObjectValue.prototype.initFields$0 = ObjectValue.prototype.initFields; | 13700 ObjectValue.prototype.initFields$0 = ObjectValue.prototype.initFields; |
| 13666 // ********** Code for GlobalValue ************** | 13701 // ********** Code for GlobalValue ************** |
| 13667 $inherits(GlobalValue, Value); | 13702 $inherits(GlobalValue, Value); |
| 13668 function GlobalValue(type, code, isConst, field, name, exp, span, deps) { | 13703 function GlobalValue(type, code, isConst, field, name, exp, span, deps) { |
| 13669 this.exp = exp; | 13704 this.exp = exp; |
| 13670 this.field = field; | 13705 this.field = field; |
| 13671 this.name = name; | 13706 this.name = name; |
| 13672 this.dependencies = []; | 13707 this.dependencies = []; |
| 13673 this.isConst = isConst; | 13708 this.isConst = isConst; |
| 13674 Value.call(this, type, code, span); | 13709 Value.call(this, type, code, span); |
| 13675 for (var $$i = 0;$$i < deps.get$length(); $$i++) { | 13710 for (var $$i = 0;$$i < deps.get$length(); $$i++) { |
| 13676 var dep = deps.$index($$i); | 13711 var dep = deps[$$i]; |
| 13677 if ((dep instanceof GlobalValue)) { | 13712 if ((dep instanceof GlobalValue)) { |
| 13678 this.dependencies.add(dep); | 13713 this.dependencies.add(dep); |
| 13679 this.dependencies.addAll(dep.get$dependencies()); | 13714 this.dependencies.addAll(dep.get$dependencies()); |
| 13680 } | 13715 } |
| 13681 } | 13716 } |
| 13682 } | 13717 } |
| 13683 GlobalValue.prototype.get$field = function() { return this.field; }; | 13718 GlobalValue.prototype.get$field = function() { return this.field; }; |
| 13684 GlobalValue.prototype.get$name = function() { return this.name; }; | 13719 GlobalValue.prototype.get$name = function() { return this.name; }; |
| 13685 GlobalValue.prototype.get$exp = function() { return this.exp; }; | 13720 GlobalValue.prototype.get$exp = function() { return this.exp; }; |
| 13686 GlobalValue.prototype.get$isConst = function() { return this.isConst; }; | 13721 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() { | 13767 BareValue.prototype.get$needsTemp = function() { |
| 13733 return false; | 13768 return false; |
| 13734 } | 13769 } |
| 13735 BareValue.prototype._shouldBindDynamically = function() { | 13770 BareValue.prototype._shouldBindDynamically = function() { |
| 13736 return false; | 13771 return false; |
| 13737 } | 13772 } |
| 13738 BareValue.prototype.get$code = function() { | 13773 BareValue.prototype.get$code = function() { |
| 13739 return this._code; | 13774 return this._code; |
| 13740 } | 13775 } |
| 13741 BareValue.prototype._ensureCode = function() { | 13776 BareValue.prototype._ensureCode = function() { |
| 13742 if (this._code == null) this._code = this.isType ? this.type.get$jsname() : th
is.home._makeThisCode(); | 13777 if (this._code == null) this._code = this.isType ? this.get$type().get$jsname(
) : this.home._makeThisCode(); |
| 13743 } | 13778 } |
| 13744 BareValue.prototype._tryResolveMember = function(context, resolveType, name) { | 13779 BareValue.prototype._tryResolveMember = function(context, name, isDynamic, node)
{ |
| 13745 var member = resolveType.resolveMember(name); | 13780 var member = this.get$type().getMember(name); |
| 13746 if (member != null) { | 13781 if (member == null || $ne(member.get$declaringType(), this.get$type())) { |
| 13747 if ($globals.options.forceDynamic && !member.get$isStatic()) { | 13782 var libMember = this.home.get$library().lookup(name, this.span); |
| 13748 member = context.findMembers(name); | 13783 if (libMember != null) { |
| 13784 return libMember.get$preciseMemberSet(); |
| 13749 } | 13785 } |
| 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 } | 13786 } |
| 13757 this._ensureCode(); | 13787 this._ensureCode(); |
| 13758 return null; | 13788 return Value.prototype._tryResolveMember.call(this, context, name, isDynamic,
node); |
| 13759 } | 13789 } |
| 13760 // ********** Code for SuperValue ************** | 13790 // ********** Code for SuperValue ************** |
| 13761 $inherits(SuperValue, Value); | 13791 $inherits(SuperValue, Value); |
| 13762 function SuperValue(parentType, span) { | 13792 function SuperValue(parentType, span) { |
| 13763 Value.call(this, parentType, "this", span); | 13793 Value.call(this, parentType, "this", span); |
| 13764 } | 13794 } |
| 13765 SuperValue.prototype.get$needsTemp = function() { | 13795 SuperValue.prototype.get$needsTemp = function() { |
| 13766 return false; | 13796 return false; |
| 13767 } | 13797 } |
| 13768 SuperValue.prototype.get$isSuper = function() { | 13798 SuperValue.prototype.get$isSuper = function() { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13854 VariableValue.prototype.get$type = function() { | 13884 VariableValue.prototype.get$type = function() { |
| 13855 return this.value != null ? this.value.get$type() : this.get$staticType(); | 13885 return this.value != null ? this.value.get$type() : this.get$staticType(); |
| 13856 } | 13886 } |
| 13857 VariableValue.prototype.get$staticType = function() { | 13887 VariableValue.prototype.get$staticType = function() { |
| 13858 return this.type; | 13888 return this.type; |
| 13859 } | 13889 } |
| 13860 VariableValue.prototype.get$isConst = function() { | 13890 VariableValue.prototype.get$isConst = function() { |
| 13861 return this.value != null ? this.value.get$isConst() : false; | 13891 return this.value != null ? this.value.get$isConst() : false; |
| 13862 } | 13892 } |
| 13863 VariableValue.prototype.replaceValue = function(v) { | 13893 VariableValue.prototype.replaceValue = function(v) { |
| 13864 return new VariableValue(this.get$staticType(), this.code, this.span, this.isF
inal, v); | 13894 return new VariableValue(this.get$staticType(), this.get$code(), this.span, th
is.isFinal, v); |
| 13865 } | 13895 } |
| 13866 VariableValue.prototype.unop = function(kind, context, node) { | 13896 VariableValue.prototype.unop = function(kind, context, node) { |
| 13867 if (this.value != null) { | 13897 if (this.value != null) { |
| 13868 return this.replaceValue(this.value.unop(kind, context, node)); | 13898 return this.replaceValue(this.value.unop(kind, context, node)); |
| 13869 } | 13899 } |
| 13870 return Value.prototype.unop.call(this, kind, context, node); | 13900 return Value.prototype.unop.call(this, kind, context, node); |
| 13871 } | 13901 } |
| 13872 VariableValue.prototype.binop = function(kind, other, context, node) { | 13902 VariableValue.prototype.binop = function(kind, other, context, node) { |
| 13873 if (this.value != null) { | 13903 if (this.value != null) { |
| 13874 return this.replaceValue(this.value.binop(kind, VariableValue._unwrap(other)
, context, node)); | 13904 return this.replaceValue(this.value.binop(kind, VariableValue._unwrap(other)
, context, node)); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 13887 if (this._location != null) { | 13917 if (this._location != null) { |
| 13888 return ("CompilerException: " + this._location.toMessageString(this._lang_me
ssage)); | 13918 return ("CompilerException: " + this._location.toMessageString(this._lang_me
ssage)); |
| 13889 } | 13919 } |
| 13890 else { | 13920 else { |
| 13891 return ("CompilerException: " + this._lang_message); | 13921 return ("CompilerException: " + this._lang_message); |
| 13892 } | 13922 } |
| 13893 } | 13923 } |
| 13894 CompilerException.prototype.toString$0 = CompilerException.prototype.toString; | 13924 CompilerException.prototype.toString$0 = CompilerException.prototype.toString; |
| 13895 // ********** Code for CounterLog ************** | 13925 // ********** Code for CounterLog ************** |
| 13896 function CounterLog() { | 13926 function CounterLog() { |
| 13927 this.msetN = (0); |
| 13897 this.objectProtoMembers = (0); | 13928 this.objectProtoMembers = (0); |
| 13898 this.dynamicMethodCalls = (0); | 13929 this.dynamicMethodCalls = (0); |
| 13899 this.typeAsserts = (0); | 13930 this.typeAsserts = (0); |
| 13931 this.invokeCalls = (0); |
| 13900 } | 13932 } |
| 13901 CounterLog.prototype.info = function() { | 13933 CounterLog.prototype.info = function() { |
| 13902 $globals.world.info(("Dynamically typed method calls: " + this.dynamicMethodCa
lls)); | 13934 $globals.world.info(("Dynamically typed method calls: " + this.dynamicMethodCa
lls)); |
| 13903 $globals.world.info(("Generated type assertions: " + this.typeAsserts)); | 13935 $globals.world.info(("Generated type assertions: " + this.typeAsserts)); |
| 13904 $globals.world.info(("Members on Object.prototype: " + this.objectProtoMembers
)); | 13936 $globals.world.info(("Members on Object.prototype: " + this.objectProtoMembers
)); |
| 13937 $globals.world.info(("Invoke calls: " + this.invokeCalls)); |
| 13938 $globals.world.info(("msetN calls: " + this.msetN)); |
| 13905 } | 13939 } |
| 13906 CounterLog.prototype.add = function(other) { | 13940 CounterLog.prototype.add = function(other) { |
| 13907 this.dynamicMethodCalls += other.dynamicMethodCalls; | 13941 this.dynamicMethodCalls = $add(this.dynamicMethodCalls, other.dynamicMethodCal
ls); |
| 13908 this.typeAsserts += other.typeAsserts; | 13942 this.typeAsserts = $add(this.typeAsserts, other.typeAsserts); |
| 13909 this.objectProtoMembers += other.objectProtoMembers; | 13943 this.objectProtoMembers = $add(this.objectProtoMembers, other.objectProtoMembe
rs); |
| 13944 this.invokeCalls = $add(this.invokeCalls, other.invokeCalls); |
| 13945 this.msetN = $add(this.msetN, other.msetN); |
| 13910 } | 13946 } |
| 13911 CounterLog.prototype.add$1 = CounterLog.prototype.add; | 13947 CounterLog.prototype.add$1 = CounterLog.prototype.add; |
| 13912 // ********** Code for World ************** | 13948 // ********** Code for World ************** |
| 13913 function World(files) { | 13949 function World(files) { |
| 13914 this.files = files; | 13950 this.files = files; |
| 13915 this._members = new HashMapImplementation(); | 13951 this._members = new HashMapImplementation(); |
| 13916 this._topNames = new HashMapImplementation(); | 13952 this._topNames = new HashMapImplementation(); |
| 13917 this.warnings = (0); | 13953 this.warnings = (0); |
| 13918 this.seenFatal = false; | 13954 this.seenFatal = false; |
| 13919 this.libraries = new HashMapImplementation(); | 13955 this.libraries = new HashMapImplementation(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14062 this.printStatus(); | 14098 this.printStatus(); |
| 14063 return !this.get$hasErrors(); | 14099 return !this.get$hasErrors(); |
| 14064 } | 14100 } |
| 14065 World.prototype.runLeg = function() { | 14101 World.prototype.runLeg = function() { |
| 14066 var $this = this; // closure support | 14102 var $this = this; // closure support |
| 14067 if (!$globals.options.enableLeg) return false; | 14103 if (!$globals.options.enableLeg) return false; |
| 14068 if ($globals.legCompile == null) { | 14104 if ($globals.legCompile == null) { |
| 14069 this.fatal("requested leg enabled, but no leg compiler available"); | 14105 this.fatal("requested leg enabled, but no leg compiler available"); |
| 14070 } | 14106 } |
| 14071 var res = this.withTiming("try leg compile", (function () { | 14107 var res = this.withTiming("try leg compile", (function () { |
| 14072 return $globals.legCompile($this); | 14108 return $globals.legCompile.call$1($this); |
| 14073 }) | 14109 }) |
| 14074 ); | 14110 ); |
| 14075 if (!res && $globals.options.legOnly) { | 14111 if (!res && $globals.options.legOnly) { |
| 14076 this.fatal(("Leg could not compile " + $globals.options.dartScript)); | 14112 this.fatal(("Leg could not compile " + $globals.options.dartScript)); |
| 14077 return true; | 14113 return true; |
| 14078 } | 14114 } |
| 14079 return res; | 14115 return res; |
| 14080 } | 14116 } |
| 14081 World.prototype.runCompilationPhases = function() { | 14117 World.prototype.runCompilationPhases = function() { |
| 14082 var $this = this; // closure support | 14118 var $this = this; // closure support |
| (...skipping 14 matching lines...) Expand all Loading... |
| 14097 if (this.legCode != null) { | 14133 if (this.legCode != null) { |
| 14098 return this.legCode; | 14134 return this.legCode; |
| 14099 } | 14135 } |
| 14100 else { | 14136 else { |
| 14101 return this.frogCode; | 14137 return this.frogCode; |
| 14102 } | 14138 } |
| 14103 } | 14139 } |
| 14104 World.prototype.readFile = function(filename) { | 14140 World.prototype.readFile = function(filename) { |
| 14105 try { | 14141 try { |
| 14106 var sourceFile = this.reader.readFile(filename); | 14142 var sourceFile = this.reader.readFile(filename); |
| 14107 this.dartBytesRead = this.dartBytesRead + sourceFile.get$text().get$length()
; | 14143 this.dartBytesRead = $add(this.dartBytesRead, sourceFile.get$text().get$leng
th()); |
| 14108 return sourceFile; | 14144 return sourceFile; |
| 14109 } catch (e) { | 14145 } catch (e) { |
| 14110 e = _toDartException(e); | 14146 e = _toDartException(e); |
| 14111 this.warning(("Error reading file: " + filename)); | 14147 this.warning(("Error reading file: " + filename)); |
| 14112 return new SourceFile(filename, ""); | 14148 return new SourceFile(filename, ""); |
| 14113 } | 14149 } |
| 14114 } | 14150 } |
| 14115 World.prototype.getOrAddLibrary = function(filename) { | 14151 World.prototype.getOrAddLibrary = function(filename) { |
| 14116 var library = this.libraries.$index(filename); | 14152 var library = this.libraries.$index(filename); |
| 14117 if (library == null) { | 14153 if (library == null) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 14141 } | 14177 } |
| 14142 } | 14178 } |
| 14143 } | 14179 } |
| 14144 World.prototype.processDartScript = function(script) { | 14180 World.prototype.processDartScript = function(script) { |
| 14145 if (script == null) script = $globals.options.dartScript; | 14181 if (script == null) script = $globals.options.dartScript; |
| 14146 var library = this.getOrAddLibrary(script); | 14182 var library = this.getOrAddLibrary(script); |
| 14147 this.process(); | 14183 this.process(); |
| 14148 return library; | 14184 return library; |
| 14149 } | 14185 } |
| 14150 World.prototype.resolveAll = function() { | 14186 World.prototype.resolveAll = function() { |
| 14151 var $$list = this.libraries.getValues$0(); | 14187 var $$list = this.libraries.getValues(); |
| 14152 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 14188 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 14153 var lib = $$i.next$0(); | 14189 var lib = $$i.next$0(); |
| 14154 lib.resolve$0(); | 14190 lib.resolve$0(); |
| 14155 } | 14191 } |
| 14156 var $$list = this.libraries.getValues$0(); | 14192 var $$list = this.libraries.getValues(); |
| 14157 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 14193 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 14158 var lib = $$i.next$0(); | 14194 var lib = $$i.next$0(); |
| 14159 lib.postResolveChecks$0(); | 14195 lib.postResolveChecks$0(); |
| 14160 } | 14196 } |
| 14161 } | 14197 } |
| 14162 World.prototype.get$resolveAll = function() { | 14198 World.prototype.get$resolveAll = function() { |
| 14163 return this.resolveAll.bind(this); | 14199 return this.resolveAll.bind(this); |
| 14164 } | 14200 } |
| 14165 World.prototype.findMainMethod = function(lib) { | 14201 World.prototype.findMainMethod = function(lib) { |
| 14166 var mainMembers = lib.topType.resolveMember("main"); | 14202 var main = lib.lookup("main", lib.get$span()); |
| 14167 var main = null; | 14203 if (main == null) { |
| 14168 if (mainMembers == null || $eq(mainMembers.get$members().get$length(), (0))) { | |
| 14169 this.fatal("no main method specified"); | 14204 this.fatal("no main method specified"); |
| 14170 } | 14205 } |
| 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; | 14206 return main; |
| 14183 } | 14207 } |
| 14184 World.prototype.generateCode = function(lib) { | 14208 World.prototype.generateCode = function(lib) { |
| 14185 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); | 14209 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); |
| 14186 this.gen.run(); | 14210 this.gen.run(); |
| 14187 this.frogCode = this.gen.writer.get$text(); | 14211 this.frogCode = this.gen.writer.get$text(); |
| 14188 this.jsBytesWritten = this.frogCode.length; | 14212 this.jsBytesWritten = this.frogCode.length; |
| 14189 this.gen = null; | 14213 this.gen = null; |
| 14190 } | 14214 } |
| 14191 World.prototype._message = function(color, prefix, message, span, span1, span2,
throwing) { | 14215 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 } | 14264 } |
| 14241 World.prototype.info = function(message, span, span1, span2) { | 14265 World.prototype.info = function(message, span, span1, span2) { |
| 14242 if ($globals.options.showInfo) { | 14266 if ($globals.options.showInfo) { |
| 14243 this._message($globals._GREEN_COLOR, "info: ", message, span, span1, span2,
false); | 14267 this._message($globals._GREEN_COLOR, "info: ", message, span, span1, span2,
false); |
| 14244 } | 14268 } |
| 14245 } | 14269 } |
| 14246 World.prototype.withoutForceDynamic = function(fn) { | 14270 World.prototype.withoutForceDynamic = function(fn) { |
| 14247 var oldForceDynamic = $globals.options.forceDynamic; | 14271 var oldForceDynamic = $globals.options.forceDynamic; |
| 14248 $globals.options.forceDynamic = false; | 14272 $globals.options.forceDynamic = false; |
| 14249 try { | 14273 try { |
| 14250 return fn(); | 14274 return fn.call$0(); |
| 14251 } finally { | 14275 } finally { |
| 14252 $globals.options.forceDynamic = oldForceDynamic; | 14276 $globals.options.forceDynamic = oldForceDynamic; |
| 14253 } | 14277 } |
| 14254 } | 14278 } |
| 14255 World.prototype.get$hasErrors = function() { | 14279 World.prototype.get$hasErrors = function() { |
| 14256 return this.errors > (0); | 14280 return this.errors > (0); |
| 14257 } | 14281 } |
| 14258 World.prototype.printStatus = function() { | 14282 World.prototype.printStatus = function() { |
| 14259 this.counters.info(); | 14283 this.counters.info(); |
| 14260 this.info(("compiled " + this.dartBytesRead + " bytes Dart -> " + this.jsBytes
Written + " bytes JS")); | 14284 this.info(("compiled " + this.dartBytesRead + " bytes Dart -> " + this.jsBytes
Written + " bytes JS")); |
| 14261 if (this.get$hasErrors()) { | 14285 if (this.get$hasErrors()) { |
| 14262 print(("compilation failed with " + this.errors + " errors")); | 14286 print(("compilation failed with " + this.errors + " errors")); |
| 14263 } | 14287 } |
| 14264 else { | 14288 else { |
| 14265 if (this.warnings > (0)) { | 14289 if (this.warnings > (0)) { |
| 14266 this.info(("compilation completed successfully with " + this.warnings + "
warnings")); | 14290 this.info(("compilation completed successfully with " + this.warnings + "
warnings")); |
| 14267 } | 14291 } |
| 14268 else { | 14292 else { |
| 14269 this.info("compilation completed sucessfully"); | 14293 this.info("compilation completed sucessfully"); |
| 14270 } | 14294 } |
| 14271 } | 14295 } |
| 14272 } | 14296 } |
| 14273 World.prototype.withTiming = function(name, f) { | 14297 World.prototype.withTiming = function(name, f) { |
| 14274 var sw = new StopwatchImplementation(); | 14298 var sw = new StopwatchImplementation(); |
| 14275 sw.start$0(); | 14299 sw.start$0(); |
| 14276 var result = f(); | 14300 var result = f.call$0(); |
| 14277 sw.stop$0(); | 14301 sw.stop$0(); |
| 14278 this.info(("" + name + " in " + sw.elapsedInMs$0() + "msec")); | 14302 this.info(("" + name + " in " + sw.elapsedInMs$0() + "msec")); |
| 14279 return result; | 14303 return result; |
| 14280 } | 14304 } |
| 14281 // ********** Code for FrogOptions ************** | 14305 // ********** Code for FrogOptions ************** |
| 14282 function FrogOptions(homedir, args, files) { | 14306 function FrogOptions(homedir, args, files) { |
| 14283 this.legOnly = false; | 14307 this.legOnly = false; |
| 14284 this.throwOnFatal = false; | 14308 this.throwOnFatal = false; |
| 14285 this.maxInferenceIterations = (4); | 14309 this.maxInferenceIterations = (4); |
| 14286 this.config = "dev"; | 14310 this.config = "dev"; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 14308 else { | 14332 else { |
| 14309 $globals.world.error(("Invalid configuration " + this.config)); | 14333 $globals.world.error(("Invalid configuration " + this.config)); |
| 14310 $throw("Invalid configuration"); | 14334 $throw("Invalid configuration"); |
| 14311 } | 14335 } |
| 14312 var ignoreUnrecognizedFlags = false; | 14336 var ignoreUnrecognizedFlags = false; |
| 14313 var passedLibDir = false; | 14337 var passedLibDir = false; |
| 14314 this.childArgs = []; | 14338 this.childArgs = []; |
| 14315 loop: | 14339 loop: |
| 14316 for (var i = (2); | 14340 for (var i = (2); |
| 14317 i < args.get$length(); i++) { | 14341 i < args.get$length(); i++) { |
| 14318 var arg = args.$index(i); | 14342 var arg = args[i]; |
| 14319 switch (arg) { | 14343 switch (arg) { |
| 14320 case "--enable_leg": | 14344 case "--enable_leg": |
| 14321 | 14345 |
| 14322 this.enableLeg = true; | 14346 this.enableLeg = true; |
| 14323 break; | 14347 break; |
| 14324 | 14348 |
| 14325 case "--leg_only": | 14349 case "--leg_only": |
| 14326 | 14350 |
| 14327 this.enableLeg = true; | 14351 this.enableLeg = true; |
| 14328 this.legOnly = true; | 14352 this.legOnly = true; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14401 | 14425 |
| 14402 case "--Xinfer_types": | 14426 case "--Xinfer_types": |
| 14403 | 14427 |
| 14404 this.inferTypes = true; | 14428 this.inferTypes = true; |
| 14405 break; | 14429 break; |
| 14406 | 14430 |
| 14407 default: | 14431 default: |
| 14408 | 14432 |
| 14409 if (arg.endsWith$1(".dart")) { | 14433 if (arg.endsWith$1(".dart")) { |
| 14410 this.dartScript = arg; | 14434 this.dartScript = arg; |
| 14411 this.childArgs = args.getRange$2(i + (1), args.get$length() - i - (1))
; | 14435 this.childArgs = args.getRange($add(i, (1)), args.get$length() - i - (
1)); |
| 14412 break loop; | 14436 break loop; |
| 14413 } | 14437 } |
| 14414 else if (arg.startsWith$1("--out=")) { | 14438 else if (arg.startsWith$1("--out=")) { |
| 14415 this.outfile = arg.substring$1("--out=".length); | 14439 this.outfile = arg.substring$1("--out=".length); |
| 14416 } | 14440 } |
| 14417 else if (arg.startsWith$1("--libdir=")) { | 14441 else if (arg.startsWith$1("--libdir=")) { |
| 14418 this.libDir = arg.substring$1("--libdir=".length); | 14442 this.libDir = arg.substring$1("--libdir=".length); |
| 14419 passedLibDir = true; | 14443 passedLibDir = true; |
| 14420 } | 14444 } |
| 14421 else { | 14445 else { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14559 } | 14583 } |
| 14560 else { | 14584 else { |
| 14561 code.writeln(("" + this.body + ";")); | 14585 code.writeln(("" + this.body + ";")); |
| 14562 code.exitBlock(suffix); | 14586 code.exitBlock(suffix); |
| 14563 } | 14587 } |
| 14564 } | 14588 } |
| 14565 } | 14589 } |
| 14566 VarMethodStub.prototype._needsExactTypeCheck = function() { | 14590 VarMethodStub.prototype._needsExactTypeCheck = function() { |
| 14567 var $this = this; // closure support | 14591 var $this = this; // closure support |
| 14568 if (this.member == null || this.member.declaringType.get$isObject()) return fa
lse; | 14592 if (this.member == null || this.member.declaringType.get$isObject()) return fa
lse; |
| 14569 var members = this.member.declaringType.resolveMember(this.member.name).member
s; | 14593 var members = this.member.get$potentialMemberSet().members; |
| 14570 return members.filter$1((function (m) { | 14594 return members.filter$1((function (m) { |
| 14571 return $ne(m, $this.member) && m.get$declaringType().get$isHiddenNativeType(
); | 14595 return $ne(m, $this.member) && m.get$declaringType().get$isHiddenNativeType(
); |
| 14572 }) | 14596 }) |
| 14573 ).get$length() >= (1); | 14597 ).get$length() >= (1); |
| 14574 } | 14598 } |
| 14575 VarMethodStub.prototype._useDirectCall = function(args) { | 14599 VarMethodStub.prototype._useDirectCall = function(args) { |
| 14576 if ((this.member instanceof MethodMember) && !this.member.declaringType.get$ha
sNativeSubtypes()) { | 14600 if ((this.member instanceof MethodMember) && !this.member.declaringType.get$ha
sNativeSubtypes()) { |
| 14577 var method = this.member; | 14601 var method = this.member; |
| 14578 if (method.needsArgumentConversion(args)) { | 14602 if (method.needsArgumentConversion(args)) { |
| 14579 return false; | 14603 return false; |
| 14580 } | 14604 } |
| 14581 for (var i = args.get$length(); | 14605 for (var i = args.get$length(); |
| 14582 i < method.parameters.get$length(); i++) { | 14606 i < method.parameters.get$length(); i++) { |
| 14583 if ($ne(method.parameters.$index(i).get$value().get$code(), "null")) { | 14607 if ($ne(method.parameters[i].get$value().get$code(), "null")) { |
| 14584 return false; | 14608 return false; |
| 14585 } | 14609 } |
| 14586 } | 14610 } |
| 14587 return method.namesInHomePositions(args); | 14611 return method.namesInHomePositions(args); |
| 14588 } | 14612 } |
| 14589 else { | 14613 else { |
| 14590 return false; | 14614 return false; |
| 14591 } | 14615 } |
| 14592 } | 14616 } |
| 14593 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; | 14617 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 14606 VarMethodSet.prototype.invoke = function(context, node, target, args) { | 14630 VarMethodSet.prototype.invoke = function(context, node, target, args) { |
| 14607 this._invokeMembers(context, node); | 14631 this._invokeMembers(context, node); |
| 14608 return VarMember.prototype.invoke.call(this, context, node, target, args); | 14632 return VarMember.prototype.invoke.call(this, context, node, target, args); |
| 14609 } | 14633 } |
| 14610 VarMethodSet.prototype._invokeMembers = function(context, node) { | 14634 VarMethodSet.prototype._invokeMembers = function(context, node) { |
| 14611 if (this.invoked) return; | 14635 if (this.invoked) return; |
| 14612 this.invoked = true; | 14636 this.invoked = true; |
| 14613 var hasObjectType = false; | 14637 var hasObjectType = false; |
| 14614 var $$list = this.members; | 14638 var $$list = this.members; |
| 14615 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 14639 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 14616 var member = $$list.$index($$i); | 14640 var member = $$list[$$i]; |
| 14617 var type = member.get$declaringType(); | 14641 var type = member.get$declaringType(); |
| 14618 var target = new Value(type, "this", node.span); | 14642 var target = new Value(type, "this", node.span); |
| 14619 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru
e); | 14643 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()); | 14644 var stub = new VarMethodStub(this.name, member, this.args, "return " + resul
t.get$code()); |
| 14621 type.get$varStubs().$setindex(stub.get$name(), stub); | 14645 type.get$varStubs().$setindex(stub.get$name(), stub); |
| 14622 if (type.get$isObject()) hasObjectType = true; | 14646 if (type.get$isObject()) hasObjectType = true; |
| 14623 } | 14647 } |
| 14624 if (!hasObjectType) { | 14648 if (!hasObjectType) { |
| 14625 var target = new Value($globals.world.objectType, "this", node.span); | 14649 var target = new Value($globals.world.objectType, "this", node.span); |
| 14626 var result = target.invokeNoSuchMethod$4(context, this.baseName, node, this.
args); | 14650 var result = target.invokeNoSuchMethod$4(context, this.baseName, node, this.
args); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 14637 function _otherOperator(jsname, op) { | 14661 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}"); | 14662 return ("function " + jsname + "(x, y) {\n return (typeof(x) == 'number' && t
ypeof(y) == 'number')\n ? x " + op + " y : x." + jsname + "(y);\n}"); |
| 14639 } | 14663 } |
| 14640 function map(source, mapper) { | 14664 function map(source, mapper) { |
| 14641 var result = new Array(); | 14665 var result = new Array(); |
| 14642 if (!!(source && source.is$List())) { | 14666 if (!!(source && source.is$List())) { |
| 14643 var list = source; | 14667 var list = source; |
| 14644 result.set$length(list.get$length()); | 14668 result.set$length(list.get$length()); |
| 14645 for (var i = (0); | 14669 for (var i = (0); |
| 14646 i < list.get$length(); i++) { | 14670 i < list.get$length(); i++) { |
| 14647 result.$setindex(i, mapper(list.$index(i))); | 14671 result.$setindex(i, mapper.call$1(list[i])); |
| 14648 } | 14672 } |
| 14649 } | 14673 } |
| 14650 else { | 14674 else { |
| 14651 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { | 14675 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { |
| 14652 var item = $$i.next$0(); | 14676 var item = $$i.next$0(); |
| 14653 result.add(mapper(item)); | 14677 result.add(mapper.call$1(item)); |
| 14654 } | 14678 } |
| 14655 } | 14679 } |
| 14656 return result; | 14680 return result; |
| 14657 } | 14681 } |
| 14658 function reduce(source, callback, initialValue) { | 14682 function reduce(source, callback, initialValue) { |
| 14659 var i = source.iterator$0(); | 14683 var i = source.iterator$0(); |
| 14660 var current = initialValue; | 14684 var current = initialValue; |
| 14661 if (current == null && i.hasNext$0()) { | 14685 if (current == null && i.hasNext$0()) { |
| 14662 current = i.next$0(); | 14686 current = i.next$0(); |
| 14663 } | 14687 } |
| 14664 while (i.hasNext$0()) { | 14688 while (i.hasNext$0()) { |
| 14665 current = callback.call$2(current, i.next$0()); | 14689 current = callback.call$2(current, i.next$0()); |
| 14666 } | 14690 } |
| 14667 return current; | 14691 return current; |
| 14668 } | 14692 } |
| 14669 function orderValuesByKeys(map) { | 14693 function orderValuesByKeys(map) { |
| 14670 var keys = map.getKeys(); | 14694 var keys = map.getKeys(); |
| 14671 keys.sort((function (x, y) { | 14695 keys.sort((function (x, y) { |
| 14672 return x.compareTo$1(y); | 14696 return x.compareTo$1(y); |
| 14673 }) | 14697 }) |
| 14674 ); | 14698 ); |
| 14675 var values = []; | 14699 var values = []; |
| 14676 for (var $$i = 0;$$i < keys.get$length(); $$i++) { | 14700 for (var $$i = 0;$$i < keys.get$length(); $$i++) { |
| 14677 var k = keys.$index($$i); | 14701 var k = keys[$$i]; |
| 14678 values.add$1(map.$index(k)); | 14702 values.add$1(map.$index(k)); |
| 14679 } | 14703 } |
| 14680 return values; | 14704 return values; |
| 14681 } | 14705 } |
| 14682 var world; | 14706 var world; |
| 14683 var experimentalAwaitPhase; | 14707 var experimentalAwaitPhase; |
| 14684 var legCompile; | 14708 var legCompile; |
| 14685 function initializeWorld(files) { | 14709 function initializeWorld(files) { |
| 14686 $globals.world = new World(files); | 14710 $globals.world = new World(files); |
| 14687 $globals.world.init(); | 14711 $globals.world.init(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 14704 if (name0.contains$1("$")) { | 14728 if (name0.contains$1("$")) { |
| 14705 nameBuilder.add$1(("" + name0.get$length())); | 14729 nameBuilder.add$1(("" + name0.get$length())); |
| 14706 } | 14730 } |
| 14707 nameBuilder.add$1(name0); | 14731 nameBuilder.add$1(name0); |
| 14708 } | 14732 } |
| 14709 return nameBuilder.toString$0(); | 14733 return nameBuilder.toString$0(); |
| 14710 } | 14734 } |
| 14711 // ********** Library minfrog ************** | 14735 // ********** Library minfrog ************** |
| 14712 // ********** Code for top level ************** | 14736 // ********** Code for top level ************** |
| 14713 function main() { | 14737 function main() { |
| 14714 var homedir = path.dirname(fs.realpathSync(get$process().get$argv().$index((1)
))); | 14738 var homedir = path.dirname(fs.realpathSync(get$process().get$argv()[(1)])); |
| 14715 var argv = []; | 14739 var argv = []; |
| 14716 for (var i = (0); | 14740 for (var i = (0); |
| 14717 i < get$process().get$argv().get$length(); i++) { | 14741 i < get$process().get$argv().get$length(); i++) { |
| 14718 argv.add$1(get$process().get$argv().$index(i)); | 14742 argv.add$1(get$process().get$argv()[i]); |
| 14719 if (i == (1)) { | 14743 if (i == (1)) { |
| 14720 var terminal = get$process().get$env().$index("TERM"); | 14744 var terminal = get$process().get$env().$index("TERM"); |
| 14721 if (terminal == null || !terminal.startsWith$1("xterm")) { | 14745 if (terminal == null || !terminal.startsWith$1("xterm")) { |
| 14722 argv.add$1("--no_colors"); | 14746 argv.add$1("--no_colors"); |
| 14723 } | 14747 } |
| 14724 } | 14748 } |
| 14725 } | 14749 } |
| 14726 if (compile(homedir, argv, new NodeFileSystem())) { | 14750 if (compile(homedir, argv, new NodeFileSystem())) { |
| 14727 var code = $globals.world.getGeneratedCode(); | 14751 var code = $globals.world.getGeneratedCode(); |
| 14728 if ($globals.options.compileOnly) { | 14752 if ($globals.options.compileOnly) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14767 $globals._RED_COLOR = "\x1b[31m"; | 14791 $globals._RED_COLOR = "\x1b[31m"; |
| 14768 } | 14792 } |
| 14769 var const$0000 = Object.create(EmptyQueueException.prototype, {}); | 14793 var const$0000 = Object.create(EmptyQueueException.prototype, {}); |
| 14770 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); | 14794 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); |
| 14771 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); | 14795 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); |
| 14772 var const$0007 = Object.create(IllegalAccessException.prototype, {}); | 14796 var const$0007 = Object.create(IllegalAccessException.prototype, {}); |
| 14773 var const$0008 = ImmutableList.ImmutableList$from$factory([]); | 14797 var const$0008 = ImmutableList.ImmutableList$from$factory([]); |
| 14774 var $globals = {}; | 14798 var $globals = {}; |
| 14775 $static_init(); | 14799 $static_init(); |
| 14776 main(); | 14800 main(); |
| OLD | NEW |