mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2024-11-26 20:26:09 -07:00
36 lines
838 B
JavaScript
36 lines
838 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const Mixin = require('../../utils/mixin');
|
||
|
|
||
|
class LocationInfoOpenElementStackMixin extends Mixin {
|
||
|
constructor(stack, opts) {
|
||
|
super(stack);
|
||
|
|
||
|
this.onItemPop = opts.onItemPop;
|
||
|
}
|
||
|
|
||
|
_getOverriddenMethods(mxn, orig) {
|
||
|
return {
|
||
|
pop() {
|
||
|
mxn.onItemPop(this.current);
|
||
|
orig.pop.call(this);
|
||
|
},
|
||
|
|
||
|
popAllUpToHtmlElement() {
|
||
|
for (let i = this.stackTop; i > 0; i--) {
|
||
|
mxn.onItemPop(this.items[i]);
|
||
|
}
|
||
|
|
||
|
orig.popAllUpToHtmlElement.call(this);
|
||
|
},
|
||
|
|
||
|
remove(element) {
|
||
|
mxn.onItemPop(this.current);
|
||
|
orig.remove.call(this, element);
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = LocationInfoOpenElementStackMixin;
|