Skip to content

Ice property validation is broken in JavaScript #2102

Open
@externl

Description

@externl

Ice property validation is likely broken in JavaScript. I haven't written a test to verify and the only way we would notice is if a warning when setting an Ice property was not emitted.

I noticed this when working on #2100

Issues:

self.srcFile.write(" new Property(\"/^%s\.%s/\", false, null),\n" % (self.currentSection, \

  • JS regex strings don't require surrounded /, so the regex never matched anything.

if(pattern.substring(0, dotPos - 1) != prefix)

  • This substring check is wrong, the offset should be 1 (when the above is fixed).

for(let j = 0; j < PropertyNames.validProps[i][j].length && !found; ++j)

  • The inner loop check should not be using the length of the element at j.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions