MCPcopy
hub / github.com/mishoo/UglifyJS / as_statement_array

Function as_statement_array

lib/compress.js:1995–2001  ·  view source on GitHub ↗
(thing)

Source from the content-addressed store, hash-verified

1993 }
1994
1995 function as_statement_array(thing) {
1996 if (thing === null) return [];
1997 if (thing instanceof AST_BlockStatement) return all(thing.body, safe_to_trim) ? thing.body : [ thing ];
1998 if (thing instanceof AST_EmptyStatement) return [];
1999 if (is_statement(thing)) return [ thing ];
2000 throw new Error("Can't convert thing to statement array");
2001 }
2002
2003 function is_empty(thing) {
2004 if (thing === null) return true;

Callers 3

handle_if_returnFunction · 0.85
if_break_in_loopFunction · 0.85

Calls 2

allFunction · 0.85
is_statementFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…