Permalink
Browse files

Renamed variables in example applications so they don't collide when …

…working side by side.
  • Loading branch information...
1 parent 5d10180 commit fdc815569ca68c6531e934d0a9eac7b6f22fc99f @dashersw committed Apr 9, 2011
Showing with 145 additions and 88 deletions.
  1. +10 −10 js/app/app1.js
  2. +15 −15 js/app/app2.js
  3. +8 −3 js/compiled/compiled.js
  4. +98 −48 js/compiled/source_map.js
  5. +11 −9 js/compiled/variables.out
  6. +3 −3 js/deps.js
View
@@ -11,18 +11,18 @@
goog.require('dashMVC');
goog.provide('app1');
-var view = new dashMVC.View();
-var model = new dashMVC.Model();
-var controller = new dashMVC.Controller(model);
+var aview = new dashMVC.View();
+var amodel = new dashMVC.Model();
+var acontroller = new dashMVC.Controller(amodel);
-view.attach(controller);
-model.attach(view);
+aview.attach(acontroller);
+amodel.attach(aview);
-model.setX(42);
+amodel.setX(42);
-console.log(view.getData());
+console.log(aview.getData());
-view.click();
+aview.click();
-console.log(view.getData());
-console.dir(model);
+console.log(aview.getData());
+console.dir(amodel);
View
@@ -11,23 +11,23 @@
goog.require('dashMVC');
goog.provide('app2');
-var view1 = new dashMVC.View();
-var view2 = new dashMVC.View();
-var model = new dashMVC.Model();
-var controller1 = new dashMVC.Controller(model);
-var controller2 = new dashMVC.Controller(model);
+var bview1 = new dashMVC.View();
+var bview2 = new dashMVC.View();
+var bmodel = new dashMVC.Model();
+var bcontroller1 = new dashMVC.Controller(bmodel);
+var bcontroller2 = new dashMVC.Controller(bmodel);
-view1.attach(controller1);
-view2.attach(controller2);
+bview1.attach(bcontroller1);
+bview2.attach(bcontroller2);
-model.attach(view1);
-model.attach(view2);
+bmodel.attach(bview1);
+bmodel.attach(bview2);
-model.setX(42);
-console.log(view1.getData(), view2.getData());
+bmodel.setX(42);
+console.log(bview1.getData(), bview2.getData());
-view1.click();
-console.log(view1.getData(), view2.getData());
+bview1.click();
+console.log(bview1.getData(), bview2.getData());
-view2.click();
-console.log(view1.getData(), view2.getData());
+bview2.click();
+console.log(bview1.getData(), bview2.getData());
View
@@ -13,7 +13,7 @@ function e(a){this.b=a}e.prototype.update=function(a){var b=this.b,a=a.getData()
@author armagan@amcalar.com (Armagan Amcalar)
This is an open source project. Use it at your own risk however you want, keeping this license information intact.
*/
-var g=Array.prototype,i=g.indexOf?function(a,b,c){return g.indexOf.call(a,b,c)}:function(a,b,c){c=c==null?0:c<0?Math.max(0,a.length+c):c;if(typeof a=="string"){if(typeof b!="string"||b.length!=1)return-1;return a.indexOf(b,c)}for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},j=g.forEach?function(a,b,c){g.forEach.call(a,b,c)}:function(a,b,c){for(var r=a.length,n=typeof a=="string"?a.split(""):a,h=0;h<r;h++)h in n&&b.call(c,n[h],h,a)};function k(a,b){i(a,b)>=0||a.push(b)};/*
+var g=Array.prototype,h=g.indexOf?function(a,b,c){return g.indexOf.call(a,b,c)}:function(a,b,c){c=c==null?0:c<0?Math.max(0,a.length+c):c;if(typeof a=="string"){if(typeof b!="string"||b.length!=1)return-1;return a.indexOf(b,c)}for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},j=g.forEach?function(a,b,c){g.forEach.call(a,b,c)}:function(a,b,c){for(var t=a.length,q=typeof a=="string"?a.split(""):a,i=0;i<t;i++)i in q&&b.call(c,q[i],i,a)};function k(a,b){h(a,b)>=0||a.push(b)};/*
dashMVC - a Javascript MVC that plays perfect with Google Closure Library
@author armagan@amcalar.com (Armagan Amcalar)
This is an open source project. Use it at your own risk however you want, keeping this license information intact.
@@ -28,7 +28,7 @@ function m(){this.a=[]}d(m,l);m.prototype.getData=function(){return this.data};m
@author armagan@amcalar.com (Armagan Amcalar)
This is an open source project. Use it at your own risk however you want, keeping this license information intact.
*/
-function o(){this.a=[];this.y=this.x=0}d(o,l);/*
+function n(){this.a=[];this.y=this.x=0}d(n,l);/*
dashMVC - a Javascript MVC that plays perfect with Google Closure Library
@author armagan@amcalar.com (Armagan Amcalar)
This is an open source project. Use it at your own risk however you want, keeping this license information intact.
@@ -38,4 +38,9 @@ function o(){this.a=[];this.y=this.x=0}d(o,l);/*
@author armagan@amcalar.com (Armagan Amcalar)
This is an open source project. Use it at your own risk however you want, keeping this license information intact.
*/
-var p=new m,q=new m,s=new o,t=new e(s);k(p.a,new e(s));k(q.a,t);k(s.a,p);k(s.a,q);s.x=42;f(s);console.log(p.getData(),q.getData());p.click();console.log(p.getData(),q.getData());q.click();console.log(p.getData(),q.getData());})()
+var o=new m,p=new m,r=new n,s=new e(r);k(o.a,new e(r));k(p.a,s);k(r.a,o);k(r.a,p);r.x=42;f(r);console.log(o.getData(),p.getData());o.click();console.log(o.getData(),p.getData());p.click();console.log(o.getData(),p.getData());/*
+ dashMVC - a Javascript MVC that plays perfect with Google Closure Library
+ @author armagan@amcalar.com (Armagan Amcalar)
+ This is an open source project. Use it at your own risk however you want, keeping this license information intact.
+*/
+var u=new m,v=new n;k(u.a,new e(v));k(v.a,u);v.x=42;f(v);console.log(u.getData());u.click();console.log(u.getData());console.dir(v);})()
View
@@ -1,7 +1,7 @@
{
"version":2,
"file":"../js/compiled/source_map.js",
-"lineCount":41,
+"lineCount":46,
"lineMaps":["s/cBEBABABA/ACA+ADcBEBEBEBADk/A/AEk/EEE/A/AEk/EEk/A/MDABAt",
"",
"",
@@ -42,8 +42,13 @@
"",
"",
"",
-"NEsEBMBABA9EEMBABA6EHMBABA3EKMBABA/ACA+EEA/ADE/A+MEABA/ACA+A8EIA/ADE/A+AEA8EGA/ADE/A+AEA8EGA/ADE/A+AEA8EHE/A/EDECA/ACA+cFM/A/AFc/E/A9AIc/E/A6ELU/E/cFM/A/AFc/E/A9AIc/E/A6ELU/E/cFM/A/AFc/E/A9AIc/E/A6"],
-"sources":["../js/goog/goog/base.js","../js/base/IObserver.js","../js/base/Controller.js","../js/base/Model.js","../js/base/ISubject.js","../js/goog/goog/debug/error.js","../js/goog/goog/string/string.js","../js/goog/goog/asserts/asserts.js","../js/goog/goog/array/array.js","../js/base/Subject.js","../js/base/View.js","../js/base/base.js","../js/app/app2.js"],
+"NEsEBMBABA9EEMBABA6EHMBABA3EKMBABA/ACA+EEA/ADE/A+MEABA/ACA+A8EIA/ADE/A+AEA8EGA/ADE/A+AEA8EGA/ADE/A+AEA8EHE/A/EDECA/ACA+cFM/A/AFc/E/A9AIc/E/A6ELU/E/cFM/A/AFc/E/A9AIc/E/A6ELU/E/cFM/A/AFc/E/A9AIc/E/A6",
+"",
+"",
+"",
+"",
+"NF4EBMBABA9EEMBABECA/ADE/A+MEABA/ACA+A8EIA/ADE/A+AEA8EHE/A/EDECA/ACA+cFM/A/AFc/E/A9EIU/E/cFM/A/AFc/E/A9cIM/A/ADA9"],
+"sources":["../js/goog/goog/base.js","../js/base/IObserver.js","../js/base/Controller.js","../js/base/Model.js","../js/base/ISubject.js","../js/goog/goog/debug/error.js","../js/goog/goog/string/string.js","../js/goog/goog/asserts/asserts.js","../js/goog/goog/array/array.js","../js/base/Subject.js","../js/base/View.js","../js/base/base.js","../js/app/app2.js","../js/app/app1.js"],
"mappings":[[0,1361,24,"goog.inherits"],
[0,1361,24,""],
[0,1361,24],
@@ -345,80 +350,125 @@
[3,27,14,"dashMVC.Model"],
[3,27,29,"dashMVC.Subject"],
[12,14,0],
-[12,14,4,"view1"],
-[12,14,28],
-[12,14,16,"dashMVC.View"],
-[12,15,4,"view2"],
-[12,15,28],
-[12,15,16,"dashMVC.View"],
-[12,16,4,"model"],
-[12,16,29],
-[12,16,16,"dashMVC.Model"],
-[12,18,4,"controller2"],
-[12,18,40],
-[12,18,22,"dashMVC.Controller"],
-[12,18,41,"model"],
+[12,14,4,"bview1"],
+[12,14,29],
+[12,14,17,"dashMVC.View"],
+[12,15,4,"bview2"],
+[12,15,29],
+[12,15,17,"dashMVC.View"],
+[12,16,4,"bmodel"],
+[12,16,30],
+[12,16,17,"dashMVC.Model"],
+[12,18,4,"bcontroller2"],
+[12,18,41],
+[12,18,23,"dashMVC.Controller"],
+[12,18,42,"bmodel"],
[9,34,21],
[9,34,4,"goog.array.insert"],
[9,34,22,"observers"],
-[12,20,0,"view1"],
-[12,17,40,"controller1"],
-[12,17,22,"dashMVC.Controller"],
-[12,17,41,"model"],
+[12,20,0,"bview1"],
+[12,17,41,"bcontroller1"],
+[12,17,23,"dashMVC.Controller"],
+[12,17,42,"bmodel"],
[9,34,21],
[9,34,4,"goog.array.insert"],
[9,34,22,"observers"],
-[12,21,0,"view2"],
-[12,21,13,"controller2"],
+[12,21,0,"bview2"],
+[12,21,14,"bcontroller2"],
[9,34,21],
[9,34,4,"goog.array.insert"],
[9,34,22,"observers"],
-[12,23,0,"model"],
-[12,23,13,"view1"],
+[12,23,0,"bmodel"],
+[12,23,14,"bview1"],
[9,34,21],
[9,34,4,"goog.array.insert"],
[9,34,22,"observers"],
-[12,24,0,"model"],
-[12,24,13,"view2"],
+[12,24,0,"bmodel"],
+[12,24,14,"bview2"],
[3,35,4],
[3,35,4,"x"],
-[12,26,0,"model"],
-[12,26,11,"x"],
+[12,26,0,"bmodel"],
+[12,26,12,"x"],
[3,36,15],
[3,36,4,"notify"],
-[12,26,0,"model"],
+[12,26,0,"bmodel"],
[12,27,11],
[12,27,0,"log"],
[12,27,0,"console"],
-[12,27,25],
+[12,27,26],
[12,27,12,"getData"],
-[12,27,12,"view1"],
-[12,27,42],
-[12,27,29,"getData"],
-[12,27,29,"view2"],
-[12,29,11],
+[12,27,12,"bview1"],
+[12,27,44],
+[12,27,30,"getData"],
+[12,27,30,"bview2"],
+[12,29,12],
[12,29,0,"click"],
-[12,29,0,"view1"],
+[12,29,0,"bview1"],
[12,30,11],
[12,30,0,"log"],
[12,30,0,"console"],
-[12,30,25],
+[12,30,26],
[12,30,12,"getData"],
-[12,30,12,"view1"],
-[12,30,42],
-[12,30,29,"getData"],
-[12,30,29,"view2"],
-[12,32,11],
+[12,30,12,"bview1"],
+[12,30,44],
+[12,30,30,"getData"],
+[12,30,30,"bview2"],
+[12,32,12],
[12,32,0,"click"],
-[12,32,0,"view2"],
+[12,32,0,"bview2"],
[12,33,11],
[12,33,0,"log"],
[12,33,0,"console"],
-[12,33,25],
+[12,33,26],
[12,33,12,"getData"],
-[12,33,12,"view1"],
-[12,33,42],
-[12,33,29,"getData"],
-[12,33,29,"view2"],
+[12,33,12,"bview1"],
+[12,33,44],
+[12,33,30,"getData"],
+[12,33,30,"bview2"],
+[13,14,0],
+[13,14,4,"aview"],
+[13,14,28],
+[13,14,16,"dashMVC.View"],
+[13,15,4,"amodel"],
+[13,15,30],
+[13,15,17,"dashMVC.Model"],
+[9,34,21],
+[9,34,4,"goog.array.insert"],
+[9,34,22,"observers"],
+[13,18,0,"aview"],
+[13,16,40,"acontroller"],
+[13,16,22,"dashMVC.Controller"],
+[13,16,41,"amodel"],
+[9,34,21],
+[9,34,4,"goog.array.insert"],
+[9,34,22,"observers"],
+[13,19,0,"amodel"],
+[13,19,14,"aview"],
+[3,35,4],
+[3,35,4,"x"],
+[13,21,0,"amodel"],
+[13,21,12,"x"],
+[3,36,15],
+[3,36,4,"notify"],
+[13,21,0,"amodel"],
+[13,23,11],
+[13,23,0,"log"],
+[13,23,0,"console"],
+[13,23,25],
+[13,23,12,"getData"],
+[13,23,12,"aview"],
+[13,25,11],
+[13,25,0,"click"],
+[13,25,0,"aview"],
+[13,27,11],
+[13,27,0,"log"],
+[13,27,0,"console"],
+[13,27,25],
+[13,27,12,"getData"],
+[13,27,12,"aview"],
+[13,28,11],
+[13,28,0,"dir"],
+[13,28,0,"console"],
+[13,28,12,"amodel"],
]
}
View
@@ -1,20 +1,22 @@
dashMVC$Controller:e
-model:s
-goog$array$indexOf:i
-L 5:h
-L 4:n
+goog$array$indexOf:h
+L 5:i
+L 4:q
+amodel:v
+bcontroller2:s
+aview:u
dashMVC$View:m
goog$inherits:d
goog$array$insert:k
-view1:p
JSCompiler_StaticMethods_notify:f
-view2:q
+bmodel:r
+bview1:o
+bview2:p
goog$array$ARRAY_PROTOTYPE_:g
-controller2:t
L 0:a
L 1:b
L 2:c
dashMVC$Subject:l
-L 3:r
-dashMVC$Model:o
+L 3:t
+dashMVC$Model:n
goog$array$forEach:j
View
@@ -1,11 +1,11 @@
// This file was autogenerated by goog/build/depswriter.py.
// Please do not edit.
-goog.addDependency('../../app/app1.js', ['app'], ['dashMVC']);
+goog.addDependency('../../app/app1.js', ['app1'], ['dashMVC']);
goog.addDependency('../../app/app2.js', ['app2'], ['dashMVC']);
-goog.addDependency('../../base/Controller.js', ['dashMVC.Controller'], []);
+goog.addDependency('../../base/Controller.js', ['dashMVC.Controller'], ['dashMVC.IObserver']);
goog.addDependency('../../base/IObserver.js', ['dashMVC.IObserver'], []);
goog.addDependency('../../base/ISubject.js', ['dashMVC.ISubject'], []);
goog.addDependency('../../base/Model.js', ['dashMVC.Model'], ['dashMVC.Subject']);
-goog.addDependency('../../base/Subject.js', ['dashMVC.Subject'], ['goog.array']);
+goog.addDependency('../../base/Subject.js', ['dashMVC.Subject'], ['dashMVC.ISubject', 'goog.array']);
goog.addDependency('../../base/View.js', ['dashMVC.View'], ['dashMVC.Subject']);
goog.addDependency('../../base/base.js', ['dashMVC'], ['dashMVC.Controller', 'dashMVC.Model', 'dashMVC.View']);

0 comments on commit fdc8155

Please sign in to comment.