<commit_before><?php

namespace js4php5\compiler\constructs;

use js4php5\jsc\js_exception;
use js4php5\jsc\js_syntaxerror;
use js4php5\runtime\Base;

class c_return extends BaseConstruct
{
    function __construct($expr)
    {
        $this->expr = $expr;
    }

    function emit($unusedParameter = false)
    {
        // Removing this enables the called script to return values back to PHP.
        // Not normal JS behaviour, but useful for this setup.
//        if (c_function_definition::$in_function == 0) {
            // Script return (value is returned to PHP).
//            throw new jsException(new jsSyntaxError("invalid return"));
//            return "return " . $this->expr->emit(true) . ";\n";
//        }
        if ($this->expr == ';') {
            return 'return Runtime::$undefined;\n';<commit_msg>Fixed string quotes when using newline escape seq.<commit_after><?php

namespace js4php5\compiler\constructs;

use js4php5\jsc\js_exception;
use js4php5\jsc\js_syntaxerror;
use js4php5\runtime\Base;

class c_return extends BaseConstruct
{
    function __construct($expr)
    {
        $this->expr = $expr;
    }

    function emit($unusedParameter = false)
    {
        // Removing this enables the called script to return values back to PHP.
        // Not normal JS behaviour, but useful for this setup.
//        if (c_function_definition::$in_function == 0) {
            // Script return (value is returned to PHP).
//            throw new jsException(new jsSyntaxError("invalid return"));
//            return "return " . $this->expr->emit(true) . ";\n";
//        }
        if ($this->expr == ';') {
            return "return Runtime::\$undefined;\n";
{'fraction_non_alphanumeric': 0.12604042806183116, 'fraction_numerical': 0.01070154577883472, 'mean_word_length': 2.50625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5694390', 'n_tokens_mistral': 491, 'n_tokens_neox': 490, 'n_words': 136}