blob: ad1fa6a9d9b3594e193c5f9b2431c58c4da497c2 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/base/utils.html">
<script>
'use strict';
tr.exportTo('tr.e.tquery', function() {
function Context() {
this.event = undefined;
this.ancestors = [];
}
Context.prototype = {
push: function(event) {
var ctx = new Context();
ctx.ancestors = this.ancestors.slice();
ctx.ancestors.push(event);
return ctx;
},
pop: function(event) {
var ctx = new Context();
ctx.event = this.ancestors[this.ancestors.length - 1];
ctx.ancestors = this.ancestors.slice(0, this.ancestors.length - 1);
return ctx;
}
};
return {
Context: Context
};
});
</script>