{"id":14981873,"url":"https://github.com/xiaody/babeljs-loose-spec","last_synced_at":"2026-02-12T23:02:36.063Z","repository":{"id":33891279,"uuid":"163140865","full_name":"xiaody/babeljs-loose-spec","owner":"xiaody","description":"Show some edge cases of Babel","archived":false,"fork":false,"pushed_at":"2023-03-03T23:54:20.000Z","size":1320,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-05T11:53:51.210Z","etag":null,"topics":["babeljs","ecmascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaody.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-26T05:43:22.000Z","updated_at":"2023-01-11T08:05:03.000Z","dependencies_parsed_at":"2024-09-24T08:00:36.845Z","dependency_job_id":null,"html_url":"https://github.com/xiaody/babeljs-loose-spec","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":"0.19047619047619047","last_synced_commit":"d4668fb9294e42d28250481506dfd1e70383a30d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xiaody/babeljs-loose-spec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Fbabeljs-loose-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Fbabeljs-loose-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Fbabeljs-loose-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Fbabeljs-loose-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaody","download_url":"https://codeload.github.com/xiaody/babeljs-loose-spec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Fbabeljs-loose-spec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29385010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T22:07:52.078Z","status":"ssl_error","status_checked_at":"2026-02-12T22:07:49.026Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babeljs","ecmascript"],"created_at":"2024-09-24T14:04:25.172Z","updated_at":"2026-02-12T23:02:36.045Z","avatar_url":"https://github.com/xiaody.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repo demonstrates some edge cases that could make Babel compiled code fail.\n\nThe `src` folder contains tests that could be directly excuted with `npm run test:src`,\nand all of them pass (with Node.js 10).\n\n`npm run build` compile the `src` tests to `lib` with Babel.\nUse `npm run test:lib` to run the compiled tests.\n\nDepending on the options used for Babel (`@babel/preset-env`), some compiled tests would fail:\n- `{loose: false, spec: false}` (default) 3/10 fail\n- `{loose: false, spec: true}` 2/10 fail\n- `{loose: true, spec: false}` 10/10 fail\n\n## Some explanation of the failures\n\n### classes\n\nA class must be used as constructor. The `classCallCheck` method of Babel has false negatives.\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-classes.html\n\n### shorthand-properties\n\nObject shorthand methods\nshould not have `prototype` and cannot be used as constructors.\n\nhttps://github.com/babel/babel/issues/7115\n\n### arrow-functions, spec:false (default)\n\nArrow functions\nshould not have `prototype` and cannot be used as constructors.\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-arrow-functions.html#spec\n\n### object-rest-spread, loose:true\n\nShould \"define\" properties instead of using \"assign\".\n\nhttps://babeljs.io/docs/en/next/babel-plugin-proposal-object-rest-spread.html#loose\n\n### computed-properties, loose:true\n\nShould \"define\" properties instead of using \"assign\".\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-computed-properties.html#loose\n\n### destructuring, loose:true\n\nLoose destructuring *assumes* what you want to destructure is an array, and fails for some other types.\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-destructuring.html#loose\n\n### parameters, loose:true\n\nLoose parameters with default values fail to keep the function arity for performance trade-off.\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-parameters.html#loose\n\n### for-of, loose:true\n\nLoose for-of use a \"fast path\" for all arrays to achieve better performance, which would fail if the array has its own iterator defined.\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-for-of.html#loose\n\n### template-literals, loose:true\n\nLoose template literals use the `+` operator instead of `string.concat`, which doesn't handle some special objects well.\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-template-literals.html#loose\n\n### spread, loose:true\n\nLoose spread *assumes* all iterables are arrays, which you may not agree.\n\nhttps://babeljs.io/docs/en/next/babel-plugin-transform-spread.html#loose\n\n## TL;DR\n\n- Babel is not perfect\n- Use default options of [@babel/preset-env](https://babeljs.io/docs/en/next/babel-preset-env.html) unless you know what you are doing\n- Do not write weird code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaody%2Fbabeljs-loose-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaody%2Fbabeljs-loose-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaody%2Fbabeljs-loose-spec/lists"}