UNPKG

3.42 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/errors.js"],"names":["CompilerDiagnostic","Error","constructor","message","location","errorCode","severity","FatalError","undefined","InfeasiblePathError","InvariantError"],"mappings":";;;;;;;AAAA;;;;;;;;;AASA;AAIA;AACA;AACA;AACA;AAKA;AACA;AACO,MAAMA,kBAAN,SAAiCC,KAAjC,CAAuC;AAC5CC,cAAYC,OAAZ,EAA6BC,QAA7B,EAAiEC,SAAjE,EAAoFC,QAApF,EAAwG;AACtG,UAAMH,OAAN;AAEA,SAAKC,QAAL,GAAgBA,QAAhB;AACA,SAAKE,QAAL,GAAgBA,QAAhB;AACA,SAAKD,SAAL,GAAiBA,SAAjB;AACD;;AAP2C,C,CAe9C;AACA;AACA;;;;;AACO,MAAME,UAAN,SAAyBN,KAAzB,CAA+B;AACpCC,cAAYC,OAAZ,EAA8B;AAC5B,UAAMA,YAAYK,SAAZ,GAAwB,0CAAxB,GAAqEL,OAA3E;AACD;;AAHmC,C,CAMtC;AACA;;;;;AACO,MAAMM,mBAAN,SAAkCR,KAAlC,CAAwC;AAC7CC,gBAAc;AACZ,UAAM,0BAAN;AACD;;AAH4C,C,CAM/C;;;;;AACO,MAAMQ,cAAN,SAA6BT,KAA7B,CAAmC;AACxCC,cAAYC,OAAZ,EAA6B;AAC3B,UAAMA,OAAN;AACD;;AAHuC","sourcesContent":["/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\n\n// Information: Just an informative message with no semantic implications whatsoever.\n// Warning: Prepack will produce code that matches the behavior of the original code, but the original code might have an error.\n// RecoverableError: Prepack might produce code that deviates in behavior from the original code, if the original code is not well behaved.\n// FatalError: Prepack is unable to produce code that could possibly match the behavior of the original code.\nexport type Severity = \"FatalError\" | \"RecoverableError\" | \"Warning\" | \"Information\";\nexport type ErrorHandlerResult = \"Fail\" | \"Recover\";\nexport type ErrorCode = \"PP0001\";\n\n// This is the error format used to report errors to the caller-supplied\n// error-handler\nexport class CompilerDiagnostic extends Error {\n constructor(message: string, location: ?BabelNodeSourceLocation, errorCode: string, severity: Severity) {\n super(message);\n\n this.location = location;\n this.severity = severity;\n this.errorCode = errorCode;\n }\n\n callStack: void | string;\n location: ?BabelNodeSourceLocation;\n severity: Severity;\n errorCode: string;\n}\n\n// This error is thrown to exit Prepack when an ErrorHandler returns 'FatalError'\n// This should just be a class but Babel classes doesn't work with\n// built-in super classes.\nexport class FatalError extends Error {\n constructor(message?: string) {\n super(message === undefined ? \"A fatal error occurred while prepacking.\" : message);\n }\n}\n\n// This error is thrown when exploring a path whose entry conditon implies that an earlier path conditon must be false.\n// Such paths are infeasible (dead) and must be elided from the evaluation.\nexport class InfeasiblePathError extends Error {\n constructor() {\n super(\"Infeasible path explored\");\n }\n}\n\n// This error is thrown when a false invariant is encountered. This error should never be swallowed.\nexport class InvariantError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n\nexport type ErrorHandler = (error: CompilerDiagnostic, suppressDiagnostics: boolean) => ErrorHandlerResult;\n"],"file":"errors.js"}
\No newline at end of file