-
Notifications
You must be signed in to change notification settings - Fork 0
Attribute: alias
Peter Reijnders edited this page Jan 26, 2017
·
3 revisions
- Name: alias
- Since: draft
- Usage: on 'Method'
- Allowed value: string with the operation name (e.g. 'log')
- Rationale: Some functions are present to the userprogram under more than one name, to avoid double work, confusing documentation, and strive for a smaller code base an alias can be used.
- Reference: 'console.error', 'console.info', 'console.warn'
[] interface Console {
static void log( optional DOMString text );
[Alias=log] static void warn (optional DOMString text );
};
JSFunctionSpec *JSConsole::ListMethods()
{
static JSFunctionSpec funcs[] = {
CLASSMAPPER_FN(JSConsole, log, 0),
CLASSMAPPER_FN_ALIAS(JSConsole, warn, 0, log),
JS_FS_END
};
return funcs;
}
console.log("ok");
console.warn("this is a warning");