47 lines
821 B
TypeScript
47 lines
821 B
TypeScript
|
// @noEmit: true
|
||
|
// @allowJs: true
|
||
|
// @checkJs: true
|
||
|
// @Filename: a.js
|
||
|
// @strict: true
|
||
|
|
||
|
// non top-level:
|
||
|
// all references to _map, set, get, addon should be ok
|
||
|
(function container() {
|
||
|
/** @constructor */
|
||
|
var Multimap = function() {
|
||
|
this._map = {};
|
||
|
this._map
|
||
|
this.set
|
||
|
this.get
|
||
|
this.addon
|
||
|
};
|
||
|
|
||
|
Multimap.prototype = {
|
||
|
set: function() {
|
||
|
this._map
|
||
|
this.set
|
||
|
this.get
|
||
|
this.addon
|
||
|
},
|
||
|
get() {
|
||
|
this._map
|
||
|
this.set
|
||
|
this.get
|
||
|
this.addon
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Multimap.prototype.addon = function () {
|
||
|
this._map
|
||
|
this.set
|
||
|
this.get
|
||
|
this.addon
|
||
|
}
|
||
|
|
||
|
var mm = new Multimap();
|
||
|
mm._map
|
||
|
mm.set
|
||
|
mm.get
|
||
|
mm.addon
|
||
|
});
|