3a9LL / attackapi

Automatically exported from code.google.com/p/attackapi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enter one-line summary

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. function dom.spawnSandbox(data) doens't return the sandbox with my data
as parameter.

What is the expected output? What do you see instead?

AttackAPI.dom.spawnSandbox( { myfn: function() { alert('hi'); } }
).scope.myfn();

spawnSandbox should return sandbox object with myfn extended in scope
object, but it doesn't.

What version of the product are you using? On what operating system?
2.2.0a - XP SP2

Please provide any additional information below.

this is the original piece of code:

AttackAPI.dom.spawnSandbox = function (data) {   
...
...
ifr.onload = function () 
{
    laded = true;   
        AttackAPI.core.extend(ifr.contentWindow, data);
        for (var i = 0; i < queue.length; i++)
        sandbox.evaluate(queue[i]);
    };
    return sandbox;
}
END


i resolved extending the ifr.contentWindow before the ifr.onload function:


AttackAPI.dom.spawnSandbox = function (data) {   
...
...
AttackAPI.core.extend(ifr.contentWindow, data);

    ifr.onload = function () {
        loaded = true;
        for (var i = 0; i < queue.length; i++)
            sandbox.evaluate(queue[i]);
    };

    return sandbox;
}
END

Original issue reported on code.google.com by obscures...@gmail.com on 26 Jun 2007 at 2:54

The correct syntax of this expression is:

AttackAPI.dom.spawnSandbox( { myfn: function() { alert('hi'); } }
).evaluate('myfn()');

thanks for the comment

Original comment by pdp.gnucitizen on 26 Jun 2007 at 3:00

  • Changed state: WontFix
thx a lot

Original comment by obscures...@gmail.com on 26 Jun 2007 at 3:03