summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testPropagatedFunArgs.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/basic/testPropagatedFunArgs.js')
-rw-r--r--js/src/jit-test/tests/basic/testPropagatedFunArgs.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testPropagatedFunArgs.js b/js/src/jit-test/tests/basic/testPropagatedFunArgs.js
new file mode 100644
index 0000000000..19052d1fe9
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testPropagatedFunArgs.js
@@ -0,0 +1,34 @@
+function testPropagatedFunArgs()
+{
+ var win = this;
+ var res = [], q = [];
+ function addEventListener(name, func, flag) {
+ q.push(func);
+ }
+
+ var pageInfo, obs;
+ addEventListener("load", handleLoad, true);
+
+ var observer = {
+ observe: function(win, topic, data) {
+ // obs.removeObserver(observer, "page-info-dialog-loaded");
+ handlePageInfo();
+ }
+ };
+
+ function handleLoad() {
+ pageInfo = { toString: function() { return "pageInfo"; } };
+ obs = { addObserver: function (obs, topic, data) { obs.observe(win, topic, data); } };
+ obs.addObserver(observer, "page-info-dialog-loaded", false);
+ }
+
+ function handlePageInfo() {
+ res.push(pageInfo);
+ function $(aId) { res.push(pageInfo); };
+ var feedTab = $("feedTab");
+ }
+
+ q[0]();
+ return res.join(',');
+}
+assertEq(testPropagatedFunArgs(), "pageInfo,pageInfo");