jupiterjs/jquerymx — Issue #100: v is undefined / z.Class is not a function
Author: damir8
Created: 2011-12-07 01:50:58+00:00
State: open

When stealing two or more apps using

```javascript
steal("folder/appname1", "folder/appname2");
```

Firefox returns a "v is undefined" error on Line 192:

```javascript

function(){var x=I.hookups;I.hookups={};ga(this,x);return this};z.each(["prepend","append","after","before","text","html","replaceWith","val"],function(x,B){K(B)})});steal.loaded("jquery/view/view.js");steal("jquery/lang/string",function(z){z.String.rsplit=function(r,N){for(var R=N.exec(r),I=[],X;R!==null;){X=R.index;if(X!==0){I.push(r.substring(0,X));r=r.slice(X)}I.push(R[0]);r=r.slice(R[0].length);R=N.exec(r)}r!==""&&I.push(r);return I}});steal.loaded("jquery/lang/string/rsplit/rsplit.js");

```

And fails to load either of the apps. Commenting out the second app completely resolves the error.

Stripping the second app to its bare essentials causes different errors:

```javascript

steal(

"folder/app/list",
"jquery/jquery.js",
function(){
$("#appname2").folder_featured_list();
})

```

```javascript

steal(

"jquery/controller",
"jquery/view/ejs",
"jquery/controller/view"
)
.then(

function($){

$.Controller("Folder.Appname2.List",

{
defaults : {}

},

{
init : function(){

}

});

});
```

Which causes the error "z.Class is not a function" on the production file on Line 192 of Appname2:

```javascript

q)},update:function(u){X(this.options,u);this._unbind();this.bind()},destroy:function(){if(this._destroyed)throw this.constructor.shortName+" controller already deleted";var u=this.constructor.pluginName||this.constructor._fullName;this._destroyed=true;this.element.removeClass(u);this._unbind();delete this._actions;delete this.element.data("controllers")[u];z(this).triggerHandler("destroyed");this.element=null},find:function(u){return this.element.find(u)},_set_called:true});var H=z.Controller.processors;
```

Please advise.