Title: Use of the ?. operator causes properties and function to be evaluated more than once. · Issue #9968 · angular/angular · GitHub
Open Graph Title: Use of the ?. operator causes properties and function to be evaluated more than once. · Issue #9968 · angular/angular
X Title: Use of the ?. operator causes properties and function to be evaluated more than once. · Issue #9968 · angular/angular
Description: I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question Current be...
Open Graph Description: I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma...
X Description: I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angula...
Opengraph URL: https://github.com/angular/angular/issues/9968
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use of the ?. operator causes properties and function to be evaluated more than once.","articleBody":"**I'm submitting a ...** (check one with \"x\")\n\n```\n[ ] bug report\n[x] feature request\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\n\nThe code generated for the expression `f()?.a?.b` will produce something like the following code `f() == null ? null : f().a == null ? : null : f().a.b`. Note that `f()` is evaluated three times and `a` is evaluated twice.\n\n**Expected/desired behavior**\n\nFunctions should only be evaluated once. I would expect the generated code to look more like `(t1 = f()) == null ? null : t1.a == null ? null : t1.a.b`. Note the introduction of a temporary variable to store the result of `f()`.\n\nConsider also caching the value of `t1.a` to avoid evaluating a property getter twice. This would then look like `(t1 = f()) == null ? null : (t2 = t1.a) == null ? null : t2.b`.\n\n**What is the motivation / use case for changing the behavior?**\n\nReducing the number of expensive operations during change detection.\n","author":{"url":"https://github.com/chuckjaz","@type":"Person","name":"chuckjaz"},"datePublished":"2016-07-11T18:39:55Z","url":"https://github.com/angular/angular/issues/9968"}
| 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:a3d0f0e9-13c3-31e5-4553-c424e270be7d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E768:2463BD:1C2DF4E:24045AD:6B014820 |
| html-safe-nonce | 890bf17f867c5012f10f8d4a6e216fbf9cec1aefb1836d6b9372b1f4d83fb1bb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzY4OjI0NjNCRDoxQzJERjRFOjI0MDQ1QUQ6NkIwMTQ4MjAiLCJ2aXNpdG9yX2lkIjoiODk2OTgxOTg3MjY5MTMwODU3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c15042314cf835d0d8c6393ab1f43185b68f220d96a0e016e0bb5757bc64b82e |
| hovercard-subject-tag | issue:164905289 |
| 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/angular/angular/9968/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c3e900297a338bd3e742fdef21bae533fd503734fbb361de87411e847f9e6fc2/angular/angular/issues/9968 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c3e900297a338bd3e742fdef21bae533fd503734fbb361de87411e847f9e6fc2/angular/angular/issues/9968 |
| og:image:alt | I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chuckjaz |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width