diff options
Diffstat (limited to 'Libraries/LibJS/Tests/object-basic.js')
-rw-r--r-- | Libraries/LibJS/Tests/object-basic.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/object-basic.js b/Libraries/LibJS/Tests/object-basic.js new file mode 100644 index 0000000000..9be713008c --- /dev/null +++ b/Libraries/LibJS/Tests/object-basic.js @@ -0,0 +1,17 @@ +try { + var o = { foo: "bar" }; + assert(o.foo === "bar"); + assert(o["foo"] === "bar"); + o.baz = "test"; + assert(o.baz === "test"); + assert(o["baz"] === "test"); + o[10] = "123"; + assert(o[10] === "123"); + assert(o["10"] === "123"); + o[-1] = "hello friends"; + assert(o[-1] === "hello friends"); + assert(o["-1"] === "hello friends"); + console.log("PASS"); +} catch (e) { + console.log("FAIL: " + e); +}
\ No newline at end of file |