Title: fix(view/compiler): bail on unterminated strings and invalid numeric literals by JosunLP · Pull Request #190 · bQuery/bQuery · GitHub
Open Graph Title: fix(view/compiler): bail on unterminated strings and invalid numeric literals by JosunLP · Pull Request #190 · bQuery/bQuery
X Title: fix(view/compiler): bail on unterminated strings and invalid numeric literals by JosunLP · Pull Request #190 · bQuery/bQuery
Description: Summary Fixes #170 (Medium; build-breaking). scanStringLiteral returned i + 1 unconditionally and never verified the closing quote, so an unterminated literal (
) was copied verbatim and compileExpression returned { ok: true } with a broken body. Because emitModule writes every expression into one module, a single malformed entry throws at import time and takes down all precompiled expressions in that file — with no per-expression runtime fallback. Malformed numeric literals (1ex) hit the same class of bug via scanNumericLiteral. Fix scanStringLiteral throws Bail('unterminated string literal') when it reaches end-of-input without the matching quote. Scanned numeric runs are validated against a numeric-literal regex (decimal/hex/octal/binary with _ separators); invalid runs throw Bail('invalid numeric literal'). Both bails route through the existing try/catch in compileExpression to { ok: false, reason }, so the expression cleanly falls back to the runtime evaluator instead of poisoning the module. Verification New tests: unterminated 'oops / "unclosed / greeting + 'tail bail; escaped-quote strings still compile; 1ex/1e/0xG1 bail while 1, 1.5, 0xFF, 1e3, 1_000, .5, 0b1010 still compile. Both new tests fail on the pre-fix code. View suites (compiler/view/stable/1-14): all pass. tsc --noEmit clean. 🤖 Generated with Claude Code
Open Graph Description: Summary Fixes #170 (Medium; build-breaking). scanStringLiteral returned i + 1 unconditionally and never verified the closing quote, so an unterminated literal (<p bq-text="'oops"&g...
X Description: Summary Fixes #170 (Medium; build-breaking). scanStringLiteral returned i + 1 unconditionally and never verified the closing quote, so an unterminated literal (<p bq-text="'...
Opengraph URL: https://github.com/bQuery/bQuery/pull/190
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4b8c6166-c521-ed47-6626-ebb7db6e3f1e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 973C:3D7639:6DC007:9DC9E8:6A4E396B |
| html-safe-nonce | 098299f9b22a051e20baf2255afa4fde54b31b67c92fdfa1deb640b7c0a5c3f6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzNDOjNENzYzOTo2REMwMDc6OURDOUU4OjZBNEUzOTZCIiwidmlzaXRvcl9pZCI6IjQyNzc2ODQ4MjE4MzA4MDk5NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 325d5371dc35cb52cd016bc9b91887e3aaeb7c7d7ffa9de775f4b4c5ca98f4a1 |
| hovercard-subject-tag | pull_request:4001042006 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/bQuery/bQuery/pull/190/files |
| twitter:image | https://avatars.githubusercontent.com/u/20913954?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/20913954?s=400&v=4 |
| og:image:alt | Summary Fixes #170 (Medium; build-breaking). scanStringLiteral returned i + 1 unconditionally and never verified the closing quote, so an unterminated literal (<p bq-text="'oops"&g... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 42a6d378d7587a44c93aca255096cd66b7c8eb2d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width