Minor linting changes
This commit is contained in:
parent
84a29eec65
commit
e942fb5733
@ -23,18 +23,17 @@ namespace control {
|
|||||||
* Display specified error code and stop the program.
|
* Display specified error code and stop the program.
|
||||||
*/
|
*/
|
||||||
//% shim=pxtrt::panic
|
//% shim=pxtrt::panic
|
||||||
export function panic(code: number) {
|
export function panic(code: number) { }
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the condition is false, display msg on serial console, and panic with code 098.
|
* If the condition is false, display msg on serial console, and panic with code 098.
|
||||||
*/
|
*/
|
||||||
export function assert(condition:boolean, msg?: string)
|
export function assert(condition: boolean, msg ?: string) {
|
||||||
{
|
|
||||||
if (!condition) {
|
if (!condition) {
|
||||||
console.log("ASSERTION FAILED")
|
console.log("ASSERTION FAILED")
|
||||||
if (msg != null)
|
if (msg != null) {
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
|
}
|
||||||
panic(98)
|
panic(98)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user