0ad/binaries/data/mods/_test.sim/simulation/components/test-entityid.js

24 lines
417 B
JavaScript
Raw Normal View History

function TestScript1A() {}
TestScript1A.prototype.GetX = function()
{
// Test that .entity is readonly
try
{
delete this.entity;
Engine.TS_FAIL("Missed exception");
}
catch(e) { /* noop */ }
try
{
this.entity = -1;
Engine.TS_FAIL("Missed exception");
}
catch(e) { /* noop */ }
// and return the value
return this.entity;
};
Engine.RegisterComponentType(IID_Test1, "TestScript1A", TestScript1A);