jupiterjs/steal — Issue #70: Custom type callback parameters documentation bug
Author: rodneythellama
Created: 2012-02-24 12:54:06+00:00
State: open

Hi,

I am developing a custom steal type which builds Model classes from a downloaded schema. Here is a simplified version of my code:

```javascript
steal.type("api js", function(options, success, error){
var resources = $.parseJSON(options.text);

$.each(resources, generate_model);

options.text = "";
success();
});

steal("jquery/model", "jquery/model/list")
.then({
src: "//../home?@action=api&dummy=home",
type: "api",
packaged: false
}, function($) {
"use strict";

// da da da

});
```

I have had two problems:

1. The API documentation of steal.type is this:

steal.type(type, cb( options, original, success, error )) -> undefined

But apparently the original parameter isn't used -- on the master branch today, this is at steal.js:1281.

The result of this is that my custom type was calling error() instead of success().

2. steal() seems to add .js onto the src attribute of the object it was given.

I don't think this is always desired. Perhaps there could be an option in the object passed to steal().

My resource which contains the API is called http://localhost:8917/demo/home?@action=api . It has to be called that unfortunately. The way I work around the .js addition is by adding a dummy urlparam.

Cheers,

Rodney