Skip to content

Instantly share code, notes, and snippets.

@BonsaiDen
Last active December 21, 2015 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BonsaiDen/6262270 to your computer and use it in GitHub Desktop.
Save BonsaiDen/6262270 to your computer and use it in GitHub Desktop.
Mia output for prototypical code with mia annotations.
{
"name": "Module",
"exports": {
"Module.External": {
"type": "Class",
"id": 52,
"name": "External",
"comment": {
"description": "The External Class",
"params": [{
"type": "String",
"description": "The name of the external",
"defaultValue": null
}],
"returns": null
},
"bases": [13],
"params": ["name"],
"statics": [],
"members": [{
"type": "Property",
"id": 43,
"name": "name",
"comment": {
"description": null,
"params": [{
"type": "String",
"description": "Name",
"defaultValue": null
}],
"returns": null
}
}, {
"type": "Method",
"id": 85,
"name": "add",
"comment": {
"description": null,
"params": [{
"type": "Integer",
"description": "Value A",
"defaultValue": null
}, {
"type": "Integer",
"description": "Value B",
"defaultValue": null
}],
"returns": {
"type": "Integer",
"description": "The result",
"defaultValue": null
}
},
"params": ["a", "b"],
"supers": [13]
}]
}
},
"related": {
"Internal": {
"type": "Class",
"id": 13,
"name": "Internal",
"comment": {
"description": "A Internal Base Class",
"params": [{
"type": "String",
"description": "The name of the internal",
"defaultValue": null
}],
"returns": null
},
"bases": [],
"params": [],
"statics": [{
"type": "Property",
"id": 19,
"name": "uid",
"comment": {
"description": null,
"params": [{
"type": "Integer",
"description": "Unique ID counter for instance ids",
"defaultValue": null
}],
"returns": null
}
}],
"members": [{
"type": "Property",
"id": 10,
"name": "id",
"comment": {
"description": null,
"params": [{
"type": "Integer",
"description": "The unique ID of the class instance",
"defaultValue": null
}],
"returns": null
}
}, {
"type": "Method",
"id": 34,
"name": "add",
"comment": {
"description": null,
"params": [{
"type": "Integer",
"description": "Value A",
"defaultValue": null
}, {
"type": "Integer",
"description": "Value B",
"defaultValue": null
}],
"returns": {
"type": "Integer",
"description": "The result",
"defaultValue": null
}
},
"params": ["a", "b"],
"supers": []
}]
}
},
"internal": {}
}
/**
* Top level module documentation.
*/
(function(exports) {
/** A Internal Base Class; {String} The name of the internal */
var Internal = function() {
/** {Integer}: The unique ID of the class instance */
this.id = ++Internal.id;
};
/** {Integer}: Unique ID counter for instance ids */
Internal.uid = 0;
/** {Integer}: Value A; {Integer}: Value B -> {Integer}: The result */
Internal.prototype.add = function(a, b) {
return a + b;
};
/** The External Class; {String} The name of the external */
function External(name) {
/** {String}: Name */
this.name = name;
Internal.call(this);
}
External.prototype = Object.create(Internal.prototype);
/** {Integer}: Value A; {Integer}: Value B -> {Integer}: The result */
External.prototype.add = function(a, b) {
return Internal.prototype.add.call(this, a, b);
};
// Public interface
exports.External = External;
})(typeof module === 'undefined' ? (window.Module = {}) : module.exports);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment