Sha256: 1b40146a933e00844962cd85380d578f9bffacfc6ce921140310f81a79ed1cef

Contents?: true

Size: 517 Bytes

Versions: 4

Compression:

Stored size: 517 Bytes

Contents

import Node from '../Node.js';
import CompileError from '../../utils/CompileError.js';
import { loopStatement } from '../../utils/patterns.js';

export default class ContinueStatement extends Node {
	transpile(code) {
		const loop = this.findNearest(loopStatement);
		if (loop.shouldRewriteAsFunction) {
			if (this.label)
				throw new CompileError(
					'Labels are not currently supported in a loop with locally-scoped variables',
					this
				);
			code.overwrite(this.start, this.start + 8, 'return');
		}
	}
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jass-0.9.5 vendor/node_modules/buble/src/program/types/ContinueStatement.js
jass-0.9.4 vendor/node_modules/buble/src/program/types/ContinueStatement.js
jass-0.9.3 vendor/node_modules/buble/src/program/types/ContinueStatement.js
jass-0.9.1 vendor/node_modules/buble/src/program/types/ContinueStatement.js