Sha256: 8fd3d88098acfe3124a44cd287e172cd1932d3a29e22beb57ec118de1f82264c

Contents?: true

Size: 1.21 KB

Versions: 25

Compression:

Stored size: 1.21 KB

Contents

module("window");

test("Window Global Scope Equivalence", function() {
	expect(7);
	
	window.foo = "abc";
	ok( window.foo == foo, "Property created on the window is available in global scope." );
	delete window.foo;
	
	try{
        $$$$$;    
	}catch(e){
	    ok( true, "Property is not in global scope." );
    }
	ok( window.$$$$$ === undefined, "Property is not in window scope." );
	load("test/unit/fixtures/external_script.js");
	ok( $$$$$ === "12345", "Property is in global scope." );
	ok( window.$$$$$ === "12345", "Property is in window scope." );
    
    try{ ok(window.Math === Math,
        "'window' object provides common global object facilities");
    }catch(e){print(e);}
    try{ ok(Math.sqrt(4) == 2,
        "'window' provides Math.* when referenced implicitly/global");
    }catch(e){print(e);}
});


test("References to the window object", function() {
    expect(3);

    try{ ok(window == window.window,
        "'window' is property of the window object");
    }catch(e){print(e);}
    try{ ok(window == self,
        "'self' refers to the current window");
    }catch(e){print(e);}
    try{ ok(window == window.top,
        "for top-level document 'window.top' refers to itself");
    }catch(e){print(e);}
});

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
envjs-0.3.3 test/unit/window.js
envjs-0.3.2 test/unit/window.js
envjs-0.3.1 test/unit/window.js
envjs-0.3.0 test/unit/window.js
envjs-0.2.0 test/unit/window.js
envjs-0.1.7 test/unit/window.js
envjs-0.1.6 test/unit/window.js
envjs-0.1.5 test/unit/window.js
envjs-0.1.4 test/unit/window.js
envjs-0.1.3 test/unit/window.js
harmony-0.5.1 vendor/envjs/test/unit/window.js
harmony-0.5 vendor/envjs/test/unit/window.js
envjs-0.1.2 test/unit/window.js
envjs-0.1.1 test/unit/window.js
envjs-0.1.0 test/unit/window.js
smparkes-envjs-0.0.12 test/unit/window.js
smparkes-envjs-0.0.11 test/unit/window.js
smparkes-envjs-0.0.10 test/unit/window.js
smparkes-envjs-0.0.9 test/unit/window.js
smparkes-envjs-0.0.8 test/unit/window.js