Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comma splice in on modifier error message. #1346

Merged
merged 2 commits into from
Jan 14, 2022

Conversation

muziejus
Copy link
Contributor

No description provided.

@rwjblue
Copy link
Member

rwjblue commented Oct 22, 2021

Nice thank you!!!

@rwjblue
Copy link
Member

rwjblue commented Oct 22, 2021

Looks like we have a few tests checking this error message that will need to be updated also:

not ok 1453 Chrome 94.0 - [4 ms] - [integration] jit :: {{on}} Modifier: asserts when callback is undefined
1527
    ---
1528
        actual: >
1529
            Error: You must pass a function as the second argument to the `on` modifier; you passed undefined. While rendering:
1530
            
1531
            this.foo
1532
        expected: >
1533
            /You must pass a function as the second argument to the `on` modifier, you passed undefined. While rendering:\n\nthis.foo/
1534
        stack: >
1535
                at OnTest.assertsWhenCallbackIsUndefined [as asserts when callback is undefined] (http://localhost:7357/148153064161/tests/assets/tests.js:14317:25)
1536
                at Object.<anonymous> (http://localhost:7357/148153064161/tests/assets/glimmer-vm.js:18255:35)
1537
                at runTest (http://localhost:7357/148153064161/tests/assets/qunit.js:3048:30)
1538
                at Test.run (http://localhost:7357/148153064161/tests/assets/qunit.js:3034:6)
1539
                at http://localhost:7357/148153064161/tests/assets/qunit.js:3265:12
1540
                at processTaskQueue (http://localhost:7357/148153064161/tests/assets/qunit.js:2621:24)
1541
        negative: >
1542
            false
1543
        browser log: |

@rwjblue
Copy link
Member

rwjblue commented Oct 22, 2021

Those tests are here

@test
'asserts when callback is missing'(assert: Assert) {
assert.throws(() => {
this.render(`<button {{on 'click'}}>Click Me</button>`);
}, /You must pass a function as the second argument to the `on` modifier/);
}
@test
'asserts when callback is undefined'(assert: Assert) {
assert.throws(() => {
this.render(`<button {{on 'click' this.foo}}>Click Me</button>`);
}, /You must pass a function as the second argument to the `on` modifier, you passed undefined. While rendering:\n\nthis.foo/);
}
@test
'asserts when callback is null'(assert: Assert) {
assert.throws(() => {
this.render(`<button {{on 'click' this.foo}}>Click Me</button>`, { foo: null });
}, /You must pass a function as the second argument to the `on` modifier, you passed null. While rendering:\n\nthis.foo/);
}

@muziejus
Copy link
Contributor Author

muziejus commented Jan 4, 2022

Thanks for your patience. I changed the tests, too.

@locks
Copy link
Contributor

locks commented Jan 14, 2022

Thanks again :)

@locks locks merged commit 93ee83f into glimmerjs:master Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants