You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: implement validation for Dictionary names and keys
This commit updates our Dictionary implementation to ensure we throw nice error messages when given invalid dictionary names or keys, such as a name for a non-existant dictionary or a key that is too long.
MSG_DEF(JSMSG_DICTIONARY_DOES_NOT_EXIST, 1, JSEXN_TYPEERR, "Dictionary constructor: No Dictionary named '{0}' exists")
49
+
MSG_DEF(JSMSG_DICTIONARY_KEY_EMPTY, 0, JSEXN_TYPEERR, "Dictionary key can not be an empty string")
50
+
MSG_DEF(JSMSG_DICTIONARY_KEY_TOO_LONG, 0, JSEXN_TYPEERR, "Dictionary key can not be more than 255 characters")
51
+
MSG_DEF(JSMSG_DICTIONARY_NAME_CONTAINS_INVALID_CHARACTER, 0, JSEXN_TYPEERR, "Dictionary constructor: name can contain only ascii alphanumeric characters, underscores, and ascii whitespace")
52
+
MSG_DEF(JSMSG_DICTIONARY_NAME_EMPTY, 0, JSEXN_TYPEERR, "Dictionary constructor: name can not be an empty string")
53
+
MSG_DEF(JSMSG_DICTIONARY_NAME_START_WITH_ASCII_ALPHA, 0, JSEXN_TYPEERR, "Dictionary constructor: name must start with an ascii alpabetical character")
54
+
MSG_DEF(JSMSG_DICTIONARY_NAME_TOO_LONG, 0, JSEXN_TYPEERR, "Dictionary constructor: name can not be more than 255 characters")
48
55
MSG_DEF(JSMSG_OBJECT_STORE_NAME_EMPTY, 0, JSEXN_TYPEERR, "ObjectStore constructor: name can not be an empty string")
49
56
MSG_DEF(JSMSG_OBJECT_STORE_NAME_TOO_LONG, 0, JSEXN_TYPEERR, "ObjectStore constructor: name can not be more than 255 characters")
50
57
MSG_DEF(JSMSG_OBJECT_STORE_NAME_NO_CONTROL_CHARACTERS, 0, JSEXN_TYPEERR, "ObjectStore constructor: name can not contain control characters (\\u0000-\\u001F)")
0 commit comments