Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for unsupported sequence in parseInteger #388

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/datetime.js
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,12 @@ const dateTime = (function () {
}
return parseInt(digits);
};
break;
case formats.SEQUENCE:
throw {
code: 'D3130',
value: formatSpec.token
};
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/jsonata.js
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ var jsonata = (function() {
"D3110": "The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",
"D3120": "Syntax error in expression passed to function eval: {{value}}",
"D3121": "Dynamic error evaluating the expression passed to function eval: {{value}}",
"D3130": "Formatting an integer as a sequence starting with {{value}} is not supported by this implementation",
"D3130": "Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",
"D3131": "In a decimal digit pattern, all digits must be from the same decimal group",
"D3132": "Unknown component specifier {{value}} in date/time picture string",
"D3133": "The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,5 +478,13 @@
"expr": "$parseInteger('FZPH', 'A')",
"data": {},
"result": 123456
},
{
"function": "#parseInteger",
"category": "errors",
"description": "unsupported picture string",
"expr": "$parseInteger('50', '#')",
"data": {},
"code": "D3130"
}
]