Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: frog/minfrog

Issue 9487012: Avoid mangling the name of native methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 $defProp(obj, prop, value) { 4 function $defProp(obj, prop, value) {
5 Object.defineProperty(obj, prop, 5 Object.defineProperty(obj, prop,
6 {value: value, enumerable: false, writable: true, configurable: true}); 6 {value: value, enumerable: false, writable: true, configurable: true});
7 } 7 }
8 Function.prototype.bind = Function.prototype.bind || 8 Function.prototype.bind = Function.prototype.bind ||
9 function(thisObj) { 9 function(thisObj) {
10 var func = this; 10 var func = this;
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 seenLabel = true; 2129 seenLabel = true;
2130 } 2130 }
2131 else if (seenLabel) { 2131 else if (seenLabel) {
2132 $globals.world.error("bare argument cannot follow named arguments", arg.ge t$span()); 2132 $globals.world.error("bare argument cannot follow named arguments", arg.ge t$span());
2133 } 2133 }
2134 args.add(this.visitValue(arg.get$value())); 2134 args.add(this.visitValue(arg.get$value()));
2135 } 2135 }
2136 return new Arguments(arguments, args); 2136 return new Arguments(arguments, args);
2137 } 2137 }
2138 MethodAnalyzer.prototype._makeLambdaMethod = function(name, func) { 2138 MethodAnalyzer.prototype._makeLambdaMethod = function(name, func) {
2139 var meth = new MethodMember(name, this.method.declaringType, func); 2139 var meth = new MethodMember.lambda$ctor(name, this.method.declaringType, func) ;
2140 meth.set$isLambda(true);
2141 meth.set$enclosingElement(this.method); 2140 meth.set$enclosingElement(this.method);
2142 meth.set$_methodData(new MethodData(meth, this._frame)); 2141 meth.set$_methodData(new MethodData(meth, this._frame));
2143 meth.resolve(); 2142 meth.resolve();
2144 return meth; 2143 return meth;
2145 } 2144 }
2146 MethodAnalyzer.prototype._pushBlock = function(node) { 2145 MethodAnalyzer.prototype._pushBlock = function(node) {
2147 this._frame.pushBlock(node); 2146 this._frame.pushBlock(node);
2148 } 2147 }
2149 MethodAnalyzer.prototype._popBlock = function(node) { 2148 MethodAnalyzer.prototype._popBlock = function(node) {
2150 this._frame.popBlock(node); 2149 this._frame.popBlock(node);
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
3136 if ($globals.world.dom != null) { 3135 if ($globals.world.dom != null) {
3137 this.ensureTypeNameOf(); 3136 this.ensureTypeNameOf();
3138 this.ensureDefProp(); 3137 this.ensureDefProp();
3139 w.writeln("$defProp(Object.prototype, \"get$typeName\", Object.prototype.$ty peNameOf);"); 3138 w.writeln("$defProp(Object.prototype, \"get$typeName\", Object.prototype.$ty peNameOf);");
3140 } 3139 }
3141 } 3140 }
3142 // ********** Code for Element ************** 3141 // ********** Code for Element **************
3143 function Element(name, _enclosingElement) { 3142 function Element(name, _enclosingElement) {
3144 this.name = name; 3143 this.name = name;
3145 this._enclosingElement = _enclosingElement; 3144 this._enclosingElement = _enclosingElement;
3146 this._jsname = $globals.world.toJsIdentifier(this.name); 3145 if (null != this.name) {
3146 var mangled = this.mangleJsName();
3147 this._jsname = mangled;
3148 }
3147 } 3149 }
3148 Element.prototype.get$name = function() { return this.name; }; 3150 Element.prototype.get$name = function() { return this.name; };
3149 Element.prototype.set$name = function(value) { return this.name = value; }; 3151 Element.prototype.set$name = function(value) { return this.name = value; };
3150 Element.prototype.set$_jsname = function(value) { return this._jsname = value; } ; 3152 Element.prototype.set$_jsname = function(value) { return this._jsname = value; } ;
3151 Element.prototype.get$library = function() { 3153 Element.prototype.get$library = function() {
3152 return null; 3154 return null;
3153 } 3155 }
3154 Element.prototype.get$span = function() { 3156 Element.prototype.get$span = function() {
3155 return null; 3157 return null;
3156 } 3158 }
(...skipping 11 matching lines...) Expand all
3168 } 3170 }
3169 Element.prototype.get$avoidNativeName = function() { 3171 Element.prototype.get$avoidNativeName = function() {
3170 return false; 3172 return false;
3171 } 3173 }
3172 Element.prototype.get$jsnamePriority = function() { 3174 Element.prototype.get$jsnamePriority = function() {
3173 return this.get$isNative() ? (2) : (this.get$library().get$isCore() ? (1) : (0 )); 3175 return this.get$isNative() ? (2) : (this.get$library().get$isCore() ? (1) : (0 ));
3174 } 3176 }
3175 Element.prototype.resolve = function() { 3177 Element.prototype.resolve = function() {
3176 3178
3177 } 3179 }
3180 Element.prototype.mangleJsName = function() {
3181 return $globals.world.toJsIdentifier(this.name);
3182 }
3178 Element.prototype.get$typeParameters = function() { 3183 Element.prototype.get$typeParameters = function() {
3179 return null; 3184 return null;
3180 } 3185 }
3181 Element.prototype.get$typeArgsInOrder = function() { 3186 Element.prototype.get$typeArgsInOrder = function() {
3182 return const$0007; 3187 return const$0007;
3183 } 3188 }
3184 Element.prototype.get$enclosingElement = function() { 3189 Element.prototype.get$enclosingElement = function() {
3185 return this._enclosingElement == null ? this.get$library() : this._enclosingEl ement; 3190 return this._enclosingElement == null ? this.get$library() : this._enclosingEl ement;
3186 } 3191 }
3187 Element.prototype.set$enclosingElement = function(e) { 3192 Element.prototype.set$enclosingElement = function(e) {
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
4309 break; 4314 break;
4310 } 4315 }
4311 s = this._scope.snapshot(); 4316 s = this._scope.snapshot();
4312 } 4317 }
4313 savedWriter.write$1(this.writer.get$text()); 4318 savedWriter.write$1(this.writer.get$text());
4314 this.writer = savedWriter; 4319 this.writer = savedWriter;
4315 savedCounters.add(this.counters); 4320 savedCounters.add(this.counters);
4316 this.counters = savedCounters; 4321 this.counters = savedCounters;
4317 } 4322 }
4318 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { 4323 MethodGenerator.prototype._makeLambdaMethod = function(name, func) {
4319 var meth = new MethodMember(name, this.method.declaringType, func); 4324 var meth = new MethodMember.lambda$ctor(name, this.method.declaringType, func) ;
4320 meth.set$isLambda(true);
4321 meth.set$enclosingElement(this.method); 4325 meth.set$enclosingElement(this.method);
4322 meth.set$_methodData(new MethodData(meth, this)); 4326 meth.set$_methodData(new MethodData(meth, this));
4323 meth.resolve(); 4327 meth.resolve();
4324 return meth; 4328 return meth;
4325 } 4329 }
4326 MethodGenerator.prototype.visitBool = function(node) { 4330 MethodGenerator.prototype.visitBool = function(node) {
4327 return this.visitValue(node).convertTo(this, $globals.world.nonNullBool); 4331 return this.visitValue(node).convertTo(this, $globals.world.nonNullBool);
4328 } 4332 }
4329 MethodGenerator.prototype.visitValue = function(node) { 4333 MethodGenerator.prototype.visitValue = function(node) {
4330 if (node == null) return null; 4334 if (node == null) return null;
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
5245 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; 5249 LibraryImport.prototype.get$prefix = function() { return this.prefix; };
5246 LibraryImport.prototype.get$library = function() { return this.library; }; 5250 LibraryImport.prototype.get$library = function() { return this.library; };
5247 LibraryImport.prototype.get$span = function() { return this.span; }; 5251 LibraryImport.prototype.get$span = function() { return this.span; };
5248 // ********** Code for Member ************** 5252 // ********** Code for Member **************
5249 $inherits(Member, Element); 5253 $inherits(Member, Element);
5250 function Member(name, declaringType) { 5254 function Member(name, declaringType) {
5251 this._provideGetter = false; 5255 this._provideGetter = false;
5252 this._provideSetter = false; 5256 this._provideSetter = false;
5253 this.declaringType = declaringType; 5257 this.declaringType = declaringType;
5254 Element.call(this, name, declaringType); 5258 Element.call(this, name, declaringType);
5255 if (this._jsname != null && declaringType != null && declaringType.get$isTop() ) {
5256 this._jsname = JsNames.getValid(this._jsname);
5257 }
5258 } 5259 }
5259 Member.prototype.get$declaringType = function() { return this.declaringType; }; 5260 Member.prototype.get$declaringType = function() { return this.declaringType; };
5260 Member.prototype.get$genericMember = function() { return this.genericMember; }; 5261 Member.prototype.get$genericMember = function() { return this.genericMember; };
5261 Member.prototype.set$genericMember = function(value) { return this.genericMember = value; }; 5262 Member.prototype.set$genericMember = function(value) { return this.genericMember = value; };
5263 Member.prototype.mangleJsName = function() {
5264 var mangled = Element.prototype.mangleJsName.call(this);
5265 if ($eq$(mangled, "split")) {
5266 return "split_";
5267 }
5268 else if (this.declaringType != null && this.declaringType.get$isTop()) {
5269 return JsNames.getValid(mangled);
5270 }
5271 else {
5272 return (this.get$isNative() && !this.name.contains(":")) ? this.name : mangl ed;
5273 }
5274 }
5262 Member.prototype.get$library = function() { 5275 Member.prototype.get$library = function() {
5263 return this.declaringType.get$library(); 5276 return this.declaringType.get$library();
5264 } 5277 }
5265 Member.prototype.get$isPrivate = function() { 5278 Member.prototype.get$isPrivate = function() {
5266 return null != this.name && this.name.startsWith("_"); 5279 return null != this.name && this.name.startsWith("_");
5267 } 5280 }
5268 Member.prototype.get$isConstructor = function() { 5281 Member.prototype.get$isConstructor = function() {
5269 return false; 5282 return false;
5270 } 5283 }
5271 Member.prototype.get$isField = function() { 5284 Member.prototype.get$isField = function() {
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
5998 return new TypeValue(this.type, node.span); 6011 return new TypeValue(this.type, node.span);
5999 } 6012 }
6000 TypeMember.prototype._set = function(context, node, target, value) { 6013 TypeMember.prototype._set = function(context, node, target, value) {
6001 $globals.world.error("cannot set type", node.span); 6014 $globals.world.error("cannot set type", node.span);
6002 } 6015 }
6003 TypeMember.prototype.invoke = function(context, node, target, args) { 6016 TypeMember.prototype.invoke = function(context, node, target, args) {
6004 $globals.world.error("cannot invoke type", node.span); 6017 $globals.world.error("cannot invoke type", node.span);
6005 } 6018 }
6006 // ********** Code for FieldMember ************** 6019 // ********** Code for FieldMember **************
6007 $inherits(FieldMember, Member); 6020 $inherits(FieldMember, Member);
6008 function FieldMember(name, declaringType, definition, value) { 6021 function FieldMember(name, declaringType, definition, value, isNative) {
6009 this.isNative = false; 6022 this.isNative = isNative;
6010 this.definition = definition; 6023 this.definition = definition;
6011 this._computing = false; 6024 this._computing = false;
6012 this.value = value; 6025 this.value = value;
6013 Member.call(this, name, declaringType); 6026 Member.call(this, name, declaringType);
6014 } 6027 }
6015 FieldMember.prototype.get$definition = function() { return this.definition; }; 6028 FieldMember.prototype.get$definition = function() { return this.definition; };
6016 FieldMember.prototype.get$value = function() { return this.value; }; 6029 FieldMember.prototype.get$value = function() { return this.value; };
6017 FieldMember.prototype.get$type = function() { return this.type; }; 6030 FieldMember.prototype.get$type = function() { return this.type; };
6018 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; 6031 FieldMember.prototype.get$isStatic = function() { return this.isStatic; };
6019 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va lue; }; 6032 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va lue; };
6020 FieldMember.prototype.get$isFinal = function() { return this.isFinal; }; 6033 FieldMember.prototype.get$isFinal = function() { return this.isFinal; };
6021 FieldMember.prototype.get$isNative = function() { return this.isNative; }; 6034 FieldMember.prototype.get$isNative = function() { return this.isNative; };
6022 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va lue; };
6023 FieldMember.prototype.override = function(other) { 6035 FieldMember.prototype.override = function(other) {
6024 if (!Member.prototype.override.call(this, other)) return false; 6036 if (!Member.prototype.override.call(this, other)) return false;
6025 if (other.get$isProperty() || other.get$isField()) { 6037 if (other.get$isProperty() || other.get$isField()) {
6026 return true; 6038 return true;
6027 } 6039 }
6028 else { 6040 else {
6029 $globals.world.error("field can only override field or property", this.get$s pan(), other.get$span()); 6041 $globals.world.error("field can only override field or property", this.get$s pan(), other.get$span());
6030 return false; 6042 return false;
6031 } 6043 }
6032 } 6044 }
6033 FieldMember.prototype.provideGetter = function() { 6045 FieldMember.prototype.provideGetter = function() {
6034 this._provideGetter = true; 6046 this._provideGetter = true;
6035 if (null != this.genericMember) { 6047 if (null != this.genericMember) {
6036 this.genericMember.provideGetter(); 6048 this.genericMember.provideGetter();
6037 } 6049 }
6038 } 6050 }
6039 FieldMember.prototype.provideSetter = function() { 6051 FieldMember.prototype.provideSetter = function() {
6040 this._provideSetter = true; 6052 this._provideSetter = true;
6041 if (null != this.genericMember) { 6053 if (null != this.genericMember) {
6042 this.genericMember.provideSetter(); 6054 this.genericMember.provideSetter();
6043 } 6055 }
6044 } 6056 }
6045 FieldMember.prototype.makeConcrete = function(concreteType) { 6057 FieldMember.prototype.makeConcrete = function(concreteType) {
6046 var ret = new FieldMember(this.name, concreteType, this.definition, this.value ); 6058 var ret = new FieldMember(this.name, concreteType, this.definition, this.value , false);
6047 ret.set$genericMember(this); 6059 ret.set$genericMember(this);
6048 ret.set$_jsname(this._jsname); 6060 ret.set$_jsname(this._jsname);
6049 return ret; 6061 return ret;
6050 } 6062 }
6051 FieldMember.prototype.get$span = function() { 6063 FieldMember.prototype.get$span = function() {
6052 return this.definition == null ? null : this.definition.span; 6064 return this.definition == null ? null : this.definition.span;
6053 } 6065 }
6054 FieldMember.prototype.get$returnType = function() { 6066 FieldMember.prototype.get$returnType = function() {
6055 return this.type; 6067 return this.type;
6056 } 6068 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
6271 function MethodMember(name, declaringType, definition) { 6283 function MethodMember(name, declaringType, definition) {
6272 this.isLambda = false; 6284 this.isLambda = false;
6273 this._provideOptionalParamInfo = false; 6285 this._provideOptionalParamInfo = false;
6274 this.isFactory = false; 6286 this.isFactory = false;
6275 this.definition = definition; 6287 this.definition = definition;
6276 this.isConst = false; 6288 this.isConst = false;
6277 this.isAbstract = false; 6289 this.isAbstract = false;
6278 this.isStatic = false; 6290 this.isStatic = false;
6279 Member.call(this, name, declaringType); 6291 Member.call(this, name, declaringType);
6280 } 6292 }
6293 MethodMember.lambda$ctor = function(name, declaringType, definition) {
6294 this.isLambda = true;
6295 this._provideOptionalParamInfo = false;
6296 this.isFactory = false;
6297 this.definition = definition;
6298 this.isConst = false;
6299 this.isAbstract = false;
6300 this.isStatic = false;
6301 Member.call(this, name, declaringType);
6302 }
6303 MethodMember.lambda$ctor.prototype = MethodMember.prototype;
6281 MethodMember.prototype.get$definition = function() { return this.definition; }; 6304 MethodMember.prototype.get$definition = function() { return this.definition; };
6282 MethodMember.prototype.get$returnType = function() { return this.returnType; }; 6305 MethodMember.prototype.get$returnType = function() { return this.returnType; };
6283 MethodMember.prototype.set$returnType = function(value) { return this.returnType = value; }; 6306 MethodMember.prototype.set$returnType = function(value) { return this.returnType = value; };
6284 MethodMember.prototype.get$parameters = function() { return this.parameters; }; 6307 MethodMember.prototype.get$parameters = function() { return this.parameters; };
6285 MethodMember.prototype.set$parameters = function(value) { return this.parameters = value; }; 6308 MethodMember.prototype.set$parameters = function(value) { return this.parameters = value; };
6286 MethodMember.prototype.set$_methodData = function(value) { return this._methodDa ta = value; }; 6309 MethodMember.prototype.set$_methodData = function(value) { return this._methodDa ta = value; };
6287 MethodMember.prototype.get$isStatic = function() { return this.isStatic; }; 6310 MethodMember.prototype.get$isStatic = function() { return this.isStatic; };
6288 MethodMember.prototype.set$isStatic = function(value) { return this.isStatic = v alue; }; 6311 MethodMember.prototype.set$isStatic = function(value) { return this.isStatic = v alue; };
6289 MethodMember.prototype.get$isAbstract = function() { return this.isAbstract; }; 6312 MethodMember.prototype.get$isAbstract = function() { return this.isAbstract; };
6290 MethodMember.prototype.set$isAbstract = function(value) { return this.isAbstract = value; }; 6313 MethodMember.prototype.set$isAbstract = function(value) { return this.isAbstract = value; };
6291 MethodMember.prototype.get$isConst = function() { return this.isConst; }; 6314 MethodMember.prototype.get$isConst = function() { return this.isConst; };
6292 MethodMember.prototype.get$isFactory = function() { return this.isFactory; }; 6315 MethodMember.prototype.get$isFactory = function() { return this.isFactory; };
6293 MethodMember.prototype.set$isLambda = function(value) { return this.isLambda = v alue; };
6294 MethodMember.prototype.get$initDelegate = function() { return this.initDelegate; }; 6316 MethodMember.prototype.get$initDelegate = function() { return this.initDelegate; };
6295 MethodMember.prototype.set$initDelegate = function(value) { return this.initDele gate = value; }; 6317 MethodMember.prototype.set$initDelegate = function(value) { return this.initDele gate = value; };
6296 MethodMember.prototype.makeConcrete = function(concreteType) { 6318 MethodMember.prototype.makeConcrete = function(concreteType) {
6297 var _name = this.get$isConstructor() ? concreteType.name : this.name; 6319 var _name = this.get$isConstructor() ? concreteType.name : this.name;
6298 var ret = new MethodMember(_name, concreteType, this.definition); 6320 var ret = new MethodMember(_name, concreteType, this.definition);
6299 ret.set$genericMember(this); 6321 ret.set$genericMember(this);
6300 ret.set$_jsname(this._jsname); 6322 ret.set$_jsname(this._jsname);
6301 return ret; 6323 return ret;
6302 } 6324 }
6303 MethodMember.prototype.get$methodData = function() { 6325 MethodMember.prototype.get$methodData = function() {
6304 if (null != this.genericMember) return this.genericMember.get$dynamic().get$me thodData(); 6326 if (null != this.genericMember) return this.genericMember.get$dynamic().get$me thodData();
6305 if (null == this._methodData) { 6327 if (null == this._methodData) {
6306 this._methodData = new MethodData(this); 6328 this._methodData = new MethodData(this);
6307 } 6329 }
6308 return this._methodData; 6330 return this._methodData;
6309 } 6331 }
6310 MethodMember.prototype.get$isConstructor = function() { 6332 MethodMember.prototype.get$isConstructor = function() {
6311 return this.name == this.declaringType.name; 6333 return this.name == this.declaringType.name;
6312 } 6334 }
6313 MethodMember.prototype.get$isMethod = function() { 6335 MethodMember.prototype.get$isMethod = function() {
6314 return !this.get$isConstructor(); 6336 return !this.get$isConstructor();
6315 } 6337 }
6316 MethodMember.prototype.get$isNative = function() { 6338 MethodMember.prototype.get$isNative = function() {
6339 if (this.definition == null) return false;
6317 return this.definition.nativeBody != null; 6340 return this.definition.nativeBody != null;
6318 } 6341 }
6319 MethodMember.prototype.get$canGet = function() { 6342 MethodMember.prototype.get$canGet = function() {
6320 return true; 6343 return true;
6321 } 6344 }
6322 MethodMember.prototype.get$canSet = function() { 6345 MethodMember.prototype.get$canSet = function() {
6323 return false; 6346 return false;
6324 } 6347 }
6325 MethodMember.prototype.get$span = function() { 6348 MethodMember.prototype.get$span = function() {
6326 return this.definition == null ? null : this.definition.span; 6349 return this.definition == null ? null : this.definition.span;
(...skipping 5507 matching lines...) Expand 10 before | Expand all | Expand 10 after
11834 DefinedType.prototype.get$directSubtypes = function() { return this.directSubtyp es; }; 11857 DefinedType.prototype.get$directSubtypes = function() { return this.directSubtyp es; };
11835 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; }; 11858 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete rs; };
11836 DefinedType.prototype.get$typeArgsInOrder = function() { return this.typeArgsInO rder; }; 11859 DefinedType.prototype.get$typeArgsInOrder = function() { return this.typeArgsInO rder; };
11837 DefinedType.prototype.set$typeArgsInOrder = function(value) { return this.typeAr gsInOrder = value; }; 11860 DefinedType.prototype.set$typeArgsInOrder = function(value) { return this.typeAr gsInOrder = value; };
11838 DefinedType.prototype.get$constructors = function() { return this.constructors; }; 11861 DefinedType.prototype.get$constructors = function() { return this.constructors; };
11839 DefinedType.prototype.get$members = function() { return this.members; }; 11862 DefinedType.prototype.get$members = function() { return this.members; };
11840 DefinedType.prototype.get$factories = function() { return this.factories; }; 11863 DefinedType.prototype.get$factories = function() { return this.factories; };
11841 DefinedType.prototype.get$_concreteTypes = function() { return this._concreteTyp es; }; 11864 DefinedType.prototype.get$_concreteTypes = function() { return this._concreteTyp es; };
11842 DefinedType.prototype.get$isUsed = function() { return this.isUsed; }; 11865 DefinedType.prototype.get$isUsed = function() { return this.isUsed; };
11843 DefinedType.prototype.get$isNative = function() { return this.isNative; }; 11866 DefinedType.prototype.get$isNative = function() { return this.isNative; };
11844 DefinedType.prototype.set$isNative = function(value) { return this.isNative = va lue; };
11845 DefinedType.prototype.set$baseGenericType = function(value) { return this.baseGe nericType = value; }; 11867 DefinedType.prototype.set$baseGenericType = function(value) { return this.baseGe nericType = value; };
11846 DefinedType.prototype.get$genericType = function() { 11868 DefinedType.prototype.get$genericType = function() {
11847 return null == this.baseGenericType ? this : this.baseGenericType; 11869 return null == this.baseGenericType ? this : this.baseGenericType;
11848 } 11870 }
11849 DefinedType.prototype.setDefinition = function(def) { 11871 DefinedType.prototype.setDefinition = function(def) {
11850 this.definition = def; 11872 this.definition = def;
11851 if ((this.definition instanceof TypeDefinition) && this.definition.get$nativeT ype() != null) { 11873 if ((this.definition instanceof TypeDefinition) && this.definition.get$nativeT ype() != null) {
11852 this.isNative = true; 11874 this.isNative = true;
11853 } 11875 }
11854 if (this.definition != null && $ne$(this.definition.get$typeParameters())) { 11876 if (this.definition != null && $ne$(this.definition.get$typeParameters())) {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
12157 i < definition.names.get$length(); i++) { 12179 i < definition.names.get$length(); i++) {
12158 var name = definition.names.$index(i).name; 12180 var name = definition.names.$index(i).name;
12159 if (this.members.containsKey(name)) { 12181 if (this.members.containsKey(name)) {
12160 $globals.world.error(("duplicate field definition of \"" + name + "\""), d efinition.span); 12182 $globals.world.error(("duplicate field definition of \"" + name + "\""), d efinition.span);
12161 return; 12183 return;
12162 } 12184 }
12163 var value = null; 12185 var value = null;
12164 if (definition.values != null) { 12186 if (definition.values != null) {
12165 value = definition.values.$index(i); 12187 value = definition.values.$index(i);
12166 } 12188 }
12167 var field = new FieldMember(name, this, definition, value); 12189 var field = new FieldMember(name, this, definition, value, this.isNative);
12168 this.members.$setindex(name, field); 12190 this.members.$setindex(name, field);
12169 if (this.isNative) {
12170 field.set$isNative(true);
12171 }
12172 } 12191 }
12173 } 12192 }
12174 DefinedType.prototype.getFactory = function(type, constructorName) { 12193 DefinedType.prototype.getFactory = function(type, constructorName) {
12175 if (this.baseGenericType != null) { 12194 if (this.baseGenericType != null) {
12176 var rr = this.baseGenericType.get$factories().getFactory(type.get$genericTyp e().name, constructorName); 12195 var rr = this.baseGenericType.get$factories().getFactory(type.get$genericTyp e().name, constructorName);
12177 if ($ne$(rr)) { 12196 if ($ne$(rr)) {
12178 $globals.world.info(("need to remap factory on " + this.name + " from " + rr.get$declaringType().name)); 12197 $globals.world.info(("need to remap factory on " + this.name + " from " + rr.get$declaringType().name));
12179 return rr; 12198 return rr;
12180 } 12199 }
12181 else { 12200 else {
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
14044 $globals.world.internalError($add$(("name mangling failed for \"" + named.ge t$jsname() + "\" "), ("(\"" + named.get$jsname() + "\" defined also in " + exist ing.get$span().get$locationText() + ")")), named.get$span()); 14063 $globals.world.internalError($add$(("name mangling failed for \"" + named.ge t$jsname() + "\" "), ("(\"" + named.get$jsname() + "\" defined also in " + exist ing.get$span().get$locationText() + ")")), named.get$span());
14045 } 14064 }
14046 this._topNames.$setindex(named.get$jsname(), named); 14065 this._topNames.$setindex(named.get$jsname(), named);
14047 } 14066 }
14048 World.prototype._addType = function(type) { 14067 World.prototype._addType = function(type) {
14049 if (!type.get$isTop()) this._addTopName(type); 14068 if (!type.get$isTop()) this._addTopName(type);
14050 } 14069 }
14051 World.prototype.toJsIdentifier = function(name) { 14070 World.prototype.toJsIdentifier = function(name) {
14052 if (name == null) return null; 14071 if (name == null) return null;
14053 if (this._jsKeywords == null) { 14072 if (this._jsKeywords == null) {
14054 this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory( ["break", "case", "catch", "continue", "debugger", "default", "delete", "do", "e lse", "finally", "for", "function", "if", "in", "instanceof", "new", "return", " switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "clas s", "enum", "export", "extends", "import", "super", "implements", "interface", " let", "package", "private", "protected", "public", "static", "yield", "split", " native"]); 14073 this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory( ["break", "case", "catch", "continue", "debugger", "default", "delete", "do", "e lse", "finally", "for", "function", "if", "in", "instanceof", "new", "return", " switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "clas s", "enum", "export", "extends", "import", "super", "implements", "interface", " let", "package", "private", "protected", "public", "static", "yield", "native"]) ;
14055 } 14074 }
14056 if (this._jsKeywords.contains(name)) { 14075 if (this._jsKeywords.contains(name)) {
14057 return $add$(name, "_"); 14076 return $add$(name, "_");
14058 } 14077 }
14059 else { 14078 else {
14060 return name.replaceAll("$", "$$").replaceAll(":", "$"); 14079 return name.replaceAll("$", "$$").replaceAll(":", "$");
14061 } 14080 }
14062 } 14081 }
14063 World.prototype.compileAndSave = function() { 14082 World.prototype.compileAndSave = function() {
14064 var success = this.compile(); 14083 var success = this.compile();
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
14823 var const$0002 = Object.create(EmptyQueueException.prototype, {}); 14842 var const$0002 = Object.create(EmptyQueueException.prototype, {});
14824 var const$0006 = Object.create(IllegalAccessException.prototype, {}); 14843 var const$0006 = Object.create(IllegalAccessException.prototype, {});
14825 var const$0007 = ImmutableList.ImmutableList$from$factory([]); 14844 var const$0007 = ImmutableList.ImmutableList$from$factory([]);
14826 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/"); 14845 var const$0009 = new JSSyntaxRegExp("^[a-zA-Z]:/");
14827 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy pe", "constructor"]); 14846 var const$0010 = ImmutableList.ImmutableList$from$factory(["__PROTO__", "prototy pe", "constructor"]);
14828 var const$0011 = ImmutableList.ImmutableList$from$factory(["NaN", "Infinity", "u ndefined", "eval", "parseInt", "parseFloat", "isNan", "isFinite", "decodeURI", " decodeURIComponent", "encodeURI", "encodeURIComponent", "Object", "Function", "A rray", "String", "Boolean", "Number", "Date", "RegExp", "Error", "EvalError", "R angeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Math", "a rguments", "escape", "unescape", "applicationCache", "closed", "Components", "co ntent", "controllers", "crypto", "defaultStatus", "dialogArguments", "directorie s", "document", "frameElement", "frames", "fullScreen", "globalStorage", "histor y", "innerHeight", "innerWidth", "length", "location", "locationbar", "localStor age", "menubar", "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPix el", "name", "navigator", "opener", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "personalbar", "pkcs11", "returnValue", "screen", "scro llbars", "scrollMaxX", "scrollMaxY", "self", "sessionStorage", "sidebar", "statu s", "statusbar", "toolbar", "top", "window", "alert", "addEventListener", "atob" , "back", "blur", "btoa", "captureEvents", "clearInterval", "clearTimeout", "clo se", "confirm", "disableExternalCapture", "dispatchEvent", "dump", "enableExtern alCapture", "escape", "find", "focus", "forward", "GeckoActiveXObject", "getAtte ntion", "getAttentionWithCycleCount", "getComputedStyle", "getSelection", "home" , "maximize", "minimize", "moveBy", "moveTo", "open", "openDialog", "postMessage ", "print", "prompt", "QueryInterface", "releaseEvents", "removeEventListener", "resizeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", "scrollBy Lines", "scrollByPages", "scrollTo", "setInterval", "setResizeable", "setTimeout ", "showModalDialog", "sizeToContent", "stop", "uuescape", "updateCommands", "XP CNativeWrapper", "XPCSafeJSOjbectWrapper", "onabort", "onbeforeunload", "onchang e", "onclick", "onclose", "oncontextmenu", "ondragdrop", "onerror", "onfocus", " onhashchange", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "o nmousemove", "onmouseout", "onmouseover", "onmouseup", "onmozorientation", "onpa int", "onreset", "onresize", "onscroll", "onselect", "onsubmit", "onunload", "on touchcancel", "ontouchend", "ontouchmove", "ontouchstart", "ongesturestart", "on gesturechange", "ongestureend", "uneval", "getPrototypeOf", "let", "yield", "abs tract", "int", "short", "boolean", "interface", "static", "byte", "long", "char" , "final", "native", "synchronized", "float", "package", "throws", "goto", "priv ate", "transient", "implements", "protected", "volatile", "double", "public", "a ttachEvent", "clientInformation", "clipboardData", "createPopup", "dialogHeight" , "dialogLeft", "dialogTop", "dialogWidth", "onafterprint", "onbeforedeactivate" , "onbeforeprint", "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", " event", "external", "Debug", "Enumerator", "Global", "Image", "ActiveXObject", " VBArray", "Components", "toString", "getClass", "constructor", "prototype", "val ueOf", "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", "CanvasPattern", "CanvasRenderingContext2D", "CDATASection", "CharacterData", "Comment", "CSS2Pro perties", "CSSRule", "CSSStyleSheet", "Document", "DocumentFragment", "DocumentT ype", "DOMException", "DOMImplementation", "DOMParser", "Element", "Event", "Ext ernalInterface", "FlashPlayer", "Form", "Frame", "History", "HTMLCollection", "H TMLDocument", "HTMLElement", "IFrame", "Image", "Input", "JSObject", "KeyEvent", "Link", "Location", "MimeType", "MouseEvent", "Navigator", "Node", "NodeList", "Option", "Plugin", "ProcessingInstruction", "Range", "RangeException", "Screen" , "Select", "Table", "TableCell", "TableRow", "TableSelection", "Text", "TextAre a", "UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", "XPathException", "X PathResult", "XSLTProcessor", "java", "Packages", "netscape", "sun", "JavaObject ", "JavaClass", "JavaArray", "JavaMember", "$wnd", "$doc", "$entry", "$moduleNam e", "$moduleBase", "$gwt_version", "$sessionId", "$stack", "$stackDepth", "$loca tion", "call"]); 14847 var const$0011 = ImmutableList.ImmutableList$from$factory(["NaN", "Infinity", "u ndefined", "eval", "parseInt", "parseFloat", "isNan", "isFinite", "decodeURI", " decodeURIComponent", "encodeURI", "encodeURIComponent", "Object", "Function", "A rray", "String", "Boolean", "Number", "Date", "RegExp", "Error", "EvalError", "R angeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Math", "a rguments", "escape", "unescape", "applicationCache", "closed", "Components", "co ntent", "controllers", "crypto", "defaultStatus", "dialogArguments", "directorie s", "document", "frameElement", "frames", "fullScreen", "globalStorage", "histor y", "innerHeight", "innerWidth", "length", "location", "locationbar", "localStor age", "menubar", "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPix el", "name", "navigator", "opener", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "personalbar", "pkcs11", "returnValue", "screen", "scro llbars", "scrollMaxX", "scrollMaxY", "self", "sessionStorage", "sidebar", "statu s", "statusbar", "toolbar", "top", "window", "alert", "addEventListener", "atob" , "back", "blur", "btoa", "captureEvents", "clearInterval", "clearTimeout", "clo se", "confirm", "disableExternalCapture", "dispatchEvent", "dump", "enableExtern alCapture", "escape", "find", "focus", "forward", "GeckoActiveXObject", "getAtte ntion", "getAttentionWithCycleCount", "getComputedStyle", "getSelection", "home" , "maximize", "minimize", "moveBy", "moveTo", "open", "openDialog", "postMessage ", "print", "prompt", "QueryInterface", "releaseEvents", "removeEventListener", "resizeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", "scrollBy Lines", "scrollByPages", "scrollTo", "setInterval", "setResizeable", "setTimeout ", "showModalDialog", "sizeToContent", "stop", "uuescape", "updateCommands", "XP CNativeWrapper", "XPCSafeJSOjbectWrapper", "onabort", "onbeforeunload", "onchang e", "onclick", "onclose", "oncontextmenu", "ondragdrop", "onerror", "onfocus", " onhashchange", "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "o nmousemove", "onmouseout", "onmouseover", "onmouseup", "onmozorientation", "onpa int", "onreset", "onresize", "onscroll", "onselect", "onsubmit", "onunload", "on touchcancel", "ontouchend", "ontouchmove", "ontouchstart", "ongesturestart", "on gesturechange", "ongestureend", "uneval", "getPrototypeOf", "let", "yield", "abs tract", "int", "short", "boolean", "interface", "static", "byte", "long", "char" , "final", "native", "synchronized", "float", "package", "throws", "goto", "priv ate", "transient", "implements", "protected", "volatile", "double", "public", "a ttachEvent", "clientInformation", "clipboardData", "createPopup", "dialogHeight" , "dialogLeft", "dialogTop", "dialogWidth", "onafterprint", "onbeforedeactivate" , "onbeforeprint", "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", " event", "external", "Debug", "Enumerator", "Global", "Image", "ActiveXObject", " VBArray", "Components", "toString", "getClass", "constructor", "prototype", "val ueOf", "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", "CanvasPattern", "CanvasRenderingContext2D", "CDATASection", "CharacterData", "Comment", "CSS2Pro perties", "CSSRule", "CSSStyleSheet", "Document", "DocumentFragment", "DocumentT ype", "DOMException", "DOMImplementation", "DOMParser", "Element", "Event", "Ext ernalInterface", "FlashPlayer", "Form", "Frame", "History", "HTMLCollection", "H TMLDocument", "HTMLElement", "IFrame", "Image", "Input", "JSObject", "KeyEvent", "Link", "Location", "MimeType", "MouseEvent", "Navigator", "Node", "NodeList", "Option", "Plugin", "ProcessingInstruction", "Range", "RangeException", "Screen" , "Select", "Table", "TableCell", "TableRow", "TableSelection", "Text", "TextAre a", "UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", "XPathException", "X PathResult", "XSLTProcessor", "java", "Packages", "netscape", "sun", "JavaObject ", "JavaClass", "JavaArray", "JavaMember", "$wnd", "$doc", "$entry", "$moduleNam e", "$moduleBase", "$gwt_version", "$sessionId", "$stack", "$stackDepth", "$loca tion", "call"]);
14829 var const$0012 = ImmutableList.ImmutableList$from$factory(["break", "delete", "f unction", "return", "typeof", "case", "do", "if", "switch", "var", "catch", "els e", "in", "this", "void", "continue", "false", "instanceof", "throw", "while", " debugger", "finally", "new", "true", "with", "default", "for", "null", "try", "a bstract", "double", "goto", "native", "static", "boolean", "enum", "implements", "package", "super", "byte", "export", "import", "private", "synchronized", "cha r", "extends", "int", "protected", "throws", "class", "final", "interface", "pub lic", "transient", "const", "float", "long", "short", "volatile"]); 14848 var const$0012 = ImmutableList.ImmutableList$from$factory(["break", "delete", "f unction", "return", "typeof", "case", "do", "if", "switch", "var", "catch", "els e", "in", "this", "void", "continue", "false", "instanceof", "throw", "while", " debugger", "finally", "new", "true", "with", "default", "for", "null", "try", "a bstract", "double", "goto", "native", "static", "boolean", "enum", "implements", "package", "super", "byte", "export", "import", "private", "synchronized", "cha r", "extends", "int", "protected", "throws", "class", "final", "interface", "pub lic", "transient", "const", "float", "long", "short", "volatile"]);
14830 var $globals = {}; 14849 var $globals = {};
14831 $static_init(); 14850 $static_init();
14832 main(); 14851 main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698