Title: Make private functions private · Issue #1537 · microsoft/TypeScript · GitHub
Open Graph Title: Make private functions private · Issue #1537 · microsoft/TypeScript
X Title: Make private functions private · Issue #1537 · microsoft/TypeScript
Description: Currently private functions are put on the prototype of a function so they are not really private. I suggest adding them as normal functions in the scope of the class so that they are in fact only accessible to the class. Example module ...
Open Graph Description: Currently private functions are put on the prototype of a function so they are not really private. I suggest adding them as normal functions in the scope of the class so that they are in fact only ...
X Description: Currently private functions are put on the prototype of a function so they are not really private. I suggest adding them as normal functions in the scope of the class so that they are in fact only ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/1537
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make private functions private","articleBody":"Currently private functions are put on the prototype of a function so they are not really private. I suggest adding them as normal functions in the scope of the class so that they are in fact only accessible to the class.\n\nExample\n\n```\nmodule Example\n{\n export class ExampleClass\n {\n method()\n {\n this.privateMethod();\n }\n private privateMethod()\n {\n console.log(\"private\");\n }\n }\n}\n```\n\nwould create\n\n```\nvar Example;\n(function (Example) {\n var ExampleClass = (function () {\n function ExampleClass() {\n }\n function ExampleClass_privateMethod()\n {\n console.log(\"private\");\n }\n ExampleClass.prototype.method = function () {\n privateMethod();\n };\n return ExampleClass;\n })();\n Example.ExampleClass = ExampleClass;\n})(Example || (Example = {}));\n```\n","author":{"url":"https://github.com/shmuelie","@type":"Person","name":"shmuelie"},"datePublished":"2014-12-19T16:08:13Z","url":"https://github.com/microsoft/TypeScript/issues/1537"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6a1061e5-6189-5a92-619a-9c6b3793101e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED54:EDA7A:8A1F6A:B0FE0A:6B00EB89 |
| html-safe-nonce | 41be10525f772553c29659c889cdc921422b669e7c7425d1e2819c97e0319992 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDU0OkVEQTdBOjhBMUY2QTpCMEZFMEE6NkIwMEVCODkiLCJ2aXNpdG9yX2lkIjoiNDg3MTE5NTY0NTEyMzI5MjA0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 324cf3e34cc17987f227ff7085d51ebcbb67c6a4bee9cea35a84221f5f5f0a0a |
| hovercard-subject-tag | issue:52498762 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/microsoft/TypeScript/1537/issue_layout |
| twitter:image | https://opengraph.githubassets.com/553f9fe40d0133596bfab495271c6049d4e74942ccbbeed26fe40a1d8919bf17/microsoft/TypeScript/issues/1537 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/553f9fe40d0133596bfab495271c6049d4e74942ccbbeed26fe40a1d8919bf17/microsoft/TypeScript/issues/1537 |
| og:image:alt | Currently private functions are put on the prototype of a function so they are not really private. I suggest adding them as normal functions in the scope of the class so that they are in fact only ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shmuelie |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width