Skip to content

Commit bc75764

Browse files
committed
Use Map for access types.
1 parent 3dc1808 commit bc75764

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/x_ite/Parser/VRMLParser.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,16 @@ function VRMLParser (scene)
9898

9999
Object .assign (Object .setPrototypeOf (VRMLParser .prototype, X3DParser .prototype),
100100
{
101-
accessTypes:
102-
{
103-
field: X3DConstants .initializeOnly,
104-
eventIn: X3DConstants .inputOnly,
105-
eventOut: X3DConstants .outputOnly,
106-
exposedField: X3DConstants .inputOutput,
107-
initializeOnly: X3DConstants .initializeOnly,
108-
inputOnly: X3DConstants .inputOnly,
109-
outputOnly: X3DConstants .outputOnly,
110-
inputOutput: X3DConstants .inputOutput,
111-
},
101+
accessTypes: new Map ([
102+
["field", X3DConstants .initializeOnly],
103+
["eventIn", X3DConstants .inputOnly],
104+
["eventOut", X3DConstants .outputOnly],
105+
["exposedField", X3DConstants .inputOutput],
106+
["initializeOnly", X3DConstants .initializeOnly],
107+
["inputOnly", X3DConstants .inputOnly],
108+
["outputOnly", X3DConstants .outputOnly],
109+
["inputOutput", X3DConstants .inputOutput],
110+
]),
112111
SFImage: new Fields .SFImage (),
113112
SFNode: new Fields .SFNode (),
114113
MFString: new Fields .MFString (),
@@ -1289,7 +1288,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, X3DParser .protot
12891288

12901289
if (this .Id ())
12911290
{
1292-
const accessType = this .accessTypes [this .result [0]];
1291+
const accessType = this .accessTypes .get (this .result [0]);
12931292

12941293
if (accessType)
12951294
{

0 commit comments

Comments
 (0)