0ad/binaries/data/mods/_test.sim/simulation/components/test-entityid.js
Ralph Sennhauser 08a5f4405f
Fix eslint rule 'no-empty'
Manual fix needed, using 'noop' comment to silence warnings and convert
for loop to a probably more readable while loop.

eslint --no-config-lookup --rule '"no-empty": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-04 20:05:02 +02:00

18 lines
415 B
JavaScript

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);