function validate() {
		var replacement;
		var expected;
		var actual;
		var code;
		var last;
		var line;
		var opts;
		var type;
		var arr;
		var idx;
		var loc;
		var msg;
		var out;

		last = 0;
		opts = {
			'includeDecimal': false
		};
		try {
			arr = RE_ANNOTATION.exec( sourceCode );
			while ( !isNull( arr ) ) {
				// Run intermediary code:
				code = sourceCode.substring( last, arr.index );
				last = arr.index + arr[ 0 ].length;
				if ( code ) {
					vm.runInContext( code, scope );
				}

				// Calculate line of current code chunk:
				idx = source.text.indexOf( arr[ 0 ] );
				line = countLines( source.text.substring( 0, idx ) ) + 1;
				loc = {
					'start': {
						'line': line,
						'column': 0
					},
					'end': {
						'line': line,
						'column': arr[ 0 ].length
					}
				};

				// Run code preceding return annotation:
				try {
					out = vm.runInContext( arr[ 0 ], scope );
					if ( RE_CONSOLE.test( arr[ 1 ] ) ) {
						actual = out;
					} else {
						actual = scope[ arr[ 1 ] ];
					}
					if ( arr[ 3 ] ) {
						actual = vm.runInContext( arr[ 3 ], scope );
					}
					expected = arr[ 4 ];
					msg = compareValues( actual, expected );
					if ( msg ) {
						opts.includeDecimal = isNumber( actual ) && contains( expected, '.' );
						replacement = createAnnotationValue( actual, opts );
						loc.range = [
							// Position after `// returns`:
							idx + arr[ 0 ].length -
							arr[ 4 ].length -
							arr[ 5 ].length,

							// Position at the end of the return annotation:
							idx + arr[ 0 ].length - arr[ 5 ].length
						];
						report( loc, msg, replacement );
					}
				} catch ( err ) {
					type = '<'+err.name+'>';
					if ( arr[ 2 ] !== 'throws' ) {
						if ( arr[ 3 ] ) {
							msg = 'Encountered an error: `'+err.message+'`.';
						} else {
							msg = 'Encountered an error while running code: `'+err.message+'`. ';
							msg += 'Did you mean to include a `// throws '+type+'` annotation instead of `// '+arr[ 2 ]+' '+arr[ 4 ]+'`?';
						}
					}
					else if ( arr[ 4 ] !== type ) {
						msg = 'Code should have a `// throws '+type+'` annotation, but received: `// '+arr[ 2 ]+' '+arr[ 4 ]+'`';
					}
					if ( msg ) {
						replacement = ( arr[ 3 ] ) ? findName( scope, arr[ 4 ] ) + ' => ' + arr[ 4 ] : 'throws '+type;
						loc.range = [
							// Position after `//`:
							idx + arr[ 0 ].length - arr[ 2 ].length - 1 -
							arr[ 4 ].length - arr[ 5 ].length,

							// Position at the end of the annotation:
							idx + arr[ 0 ].length - arr[ 5 ].length
						];
						report( loc, msg, replacement );
					}
				}
				arr = RE_ANNOTATION.exec( sourceCode );
			}
		} catch ( err ) {
			loc = {
				'start': {
					'line': 0,
					'column': 0
				},
				'end': {
					'line': countLines( source.text ),
					'column': 0
				}
			};

			// Do not report errors in `Markdown` fenced code blocks due to modules failing to load as implementations may not be available yet (readme-driven development):
			if ( filename === '<text>' && contains( err.message, 'Cannot find module' ) ) {
				return;
			}
			report( loc, 'Encountered an error while running code: '+err.message );
		} finally {
			RE_ANNOTATION.lastIndex = 0;
		}
	}
Checks whether return annotations in the current program match the actual output.

@private