Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 8fc4f9f

Browse files
author
unit-404
committed
type-cast test
1 parent 36a52a1 commit 8fc4f9f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"type": "chrome",
2121
"request": "launch",
2222
"name": "Debug Your JS",
23-
"url": "http://localhost:4000/test/index.html",
23+
"url": "http://localhost:4000/index.html",
2424
"webRoot": "${workspaceFolder}",
2525
"runtimeExecutable": "/usr/bin/thorium-browser",
2626
"runtimeArgs": [" --no-startup-window", "--headless"]

test/test.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ const I = (new Test({
2121
console.log(I);
2222
console.log(I.field0);
2323
console.log(I.field1[0], I.field1[1]);
24-
console.log(I["field1:uint16"]); // че ты несешь?
24+
console.log(I["field1:uint16"]); // type-cast getter
2525
console.log(I.field1);
26+
27+
// type casted assign
28+
I[0] = { "field0:uint16": 0xffff };
29+
console.log(I.field0);
30+
console.log(I.field1[0], I.field1[1]);

0 commit comments

Comments
 (0)