DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
|
ActionScript |
JavaScript + Closure annotation |
Notes |
|---|---|---|---|
...rest |
...rest |
/**
* @param\{...myType\}
*/
restVarName = Array.prototype.slice.call(arguments, numberOfOtherArguments);
|
Add a line 'resolving' the 'rest' in the function block |
const |
const |
/** * @const */ |
|
extends |
extends |
/**
* @extends {MyBaseClass}
*/
|
|
get/set |
get/set |
/**
* @type {string}
*/
MyClass.prototype.test;
Object.defineProperty(MyClass.prototype, 'test', {get: function() {return "GOTTEN";}, configurable: true});
Object.defineProperty(MyClass.prototype, 'test', {set: function(value) {alert(value);}, configurable: true});
|
if (Object.prototype.__defineGetter__&&!Object.defineProperty) {
Object.defineProperty=function(obj,prop,desc) {
if ("get" in desc) obj.__defineGetter__(prop,desc.get);
if ("set" in desc) obj.__defineSetter__(prop,desc.set);
}
}
or maybe, if we want to push IE < 9 support, something like: |
implements |
implements |
/**
* @extends \{MyInterface\}
*/
|
|
interface |
interface |
/** * @interface */ |
|
namespace |
namespace |
? |
It seems that if namespaces are allowed they would be some special kind of additional naming convention added to a field or method name. |
package |
package |
goog.provides("my.package.MyClass")
|
|