-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed 'undefined' error message in mapper editor.
Error was caused due to discrepancies between zone.js and monaco editor Promise.all implementation. Added polyfill patch for short term solution. Track issues: - microsoft/monaco-editor#790 - angular/zone.js#1077
- Loading branch information
Showing
4 changed files
with
80 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
src/client/flogo/flow/shared/mapper-language/language-service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
import { parse, RecognitionException, LexingError } from 'flogo-parser'; | ||
|
||
const getAsArray = (fromErrorsArr) => { | ||
return !!fromErrorsArr ? fromErrorsArr : []; | ||
}; | ||
|
||
export class LanguageService { | ||
static doValidation(expression: string): Promise<Array<RecognitionException|LexingError>> { | ||
if (!expression || !expression.trim()) { | ||
return Promise.resolve(<any>[]); | ||
} | ||
const parseResult = parse(expression); | ||
let errors = []; | ||
if (parseResult.lexErrors && parseResult.lexErrors.length > 0) { | ||
errors = errors.concat(parseResult.lexErrors); | ||
} | ||
if (parseResult.parseErrors && parseResult.parseErrors.length > 0) { | ||
errors = errors.concat(parseResult.parseErrors); | ||
} | ||
return Promise.resolve(errors); | ||
return Promise.resolve( [ | ||
...getAsArray(parseResult.lexErrors), | ||
...getAsArray(parseResult.parseErrors), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters