UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

25 lines (24 loc) 762 B
import { release } from '@awayfl/swf-loader'; /** * Returns |true| if the symbol is available in debug or release modes. Only symbols * followed by the "!" suffix are available in release builds. */ export function containsSymbol(symbols, name) { for (var i = 0; i < symbols.length; i++) { var symbol = symbols[i]; if (symbol.indexOf(name) >= 0) { var releaseSymbol = symbol[symbol.length - 1] === '!'; if (releaseSymbol) { symbol = symbol.slice(0, symbol.length - 1); } if (name !== symbol) { continue; } if (release) { return releaseSymbol; } return true; } } return false; }