Conversation
Overall package sizeSelf size: 9.19 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | @datadog/libdatadog | 0.5.0 | 29.83 MB | 29.83 MB | | @datadog/native-appsec | 8.5.1 | 19.26 MB | 19.27 MB | | @datadog/native-iast-taint-tracking | 3.3.0 | 13.77 MB | 13.78 MB | | @datadog/pprof | 5.6.0 | 9.79 MB | 10.16 MB | | @opentelemetry/core | 1.30.1 | 908.66 kB | 7.16 MB | | protobufjs | 7.4.0 | 2.77 MB | 5.42 MB | | @datadog/native-iast-rewriter | 2.8.0 | 2.6 MB | 2.74 MB | | @datadog/native-metrics | 3.1.0 | 1.06 MB | 1.46 MB | | @opentelemetry/api | 1.8.0 | 1.21 MB | 1.21 MB | | import-in-the-middle | 1.13.1 | 117.64 kB | 839.26 kB | | source-map | 0.7.4 | 226 kB | 226 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | lru-cache | 7.18.3 | 133.92 kB | 133.92 kB | | pprof-format | 2.1.0 | 111.69 kB | 111.69 kB | | @datadog/sketches-js | 2.1.1 | 109.9 kB | 109.9 kB | | lodash.sortby | 4.7.0 | 75.76 kB | 75.76 kB | | ignore | 5.3.2 | 53.63 kB | 53.63 kB | | istanbul-lib-coverage | 3.2.0 | 29.34 kB | 29.34 kB | | rfdc | 1.4.1 | 27.15 kB | 27.15 kB | | @isaacs/ttlcache | 1.4.1 | 25.2 kB | 25.2 kB | | tlhunter-sorted-set | 0.1.0 | 24.94 kB | 24.94 kB | | dc-polyfill | 0.1.6 | 24.56 kB | 24.56 kB | | shell-quote | 1.8.2 | 23.54 kB | 23.54 kB | | limiter | 1.1.5 | 23.17 kB | 23.17 kB | | retry | 0.13.1 | 18.85 kB | 18.85 kB | | semifies | 1.0.0 | 15.84 kB | 15.84 kB | | jest-docblock | 29.7.0 | 8.99 kB | 12.76 kB | | crypto-randomuuid | 1.0.0 | 11.18 kB | 11.18 kB | | ttl-set | 1.0.0 | 4.61 kB | 9.69 kB | | path-to-regexp | 0.1.12 | 6.6 kB | 6.6 kB | | koalas | 1.0.2 | 6.47 kB | 6.47 kB | | module-details-from-path | 1.0.3 | 4.47 kB | 4.47 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5488 +/- ##
==========================================
- Coverage 79.18% 79.18% -0.01%
==========================================
Files 512 512
Lines 23156 23158 +2
==========================================
+ Hits 18337 18338 +1
- Misses 4819 4820 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Datadog ReportBranch report: ✅ 0 Failed, 919 Passed, 0 Skipped, 14m 6.04s Total Time |
BenchmarksBenchmark execution time: 2025-04-01 11:53:56 Comparing candidate commit 6a8f5f0 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 946 metrics, 17 unstable metrics. |
There was a problem hiding this comment.
should this be under Array.isArray(value) at line 39 ?
There was a problem hiding this comment.
Is it because value[1] should also be compiled?
There was a problem hiding this comment.
nope. because you access it as an array...
There was a problem hiding this comment.
Under the Array.isArray(value) if-block below, I also compile the second element of the value array. If we don't want that in this case, it shouldn't be part of that if-block
There was a problem hiding this comment.
does the spec allow the user to have '@it' iterator over entities? not sure if that something we need to support..
There was a problem hiding this comment.
I've been wondering the same thing. I came to the conclusion that shouldn't be supported based on this discussion from January, but maybe I misunderstood it.
There was a problem hiding this comment.
open to interpretation. I would say: @it = [@key, @value] as entires return pairs.
another thing I don't like about the implementation is that @key get encoded as key. so if someone would like to write something: contains(keys, { @key == key }) it will fail. can we make @it, @key and @value unique so they can't override existing locals? or maybe add a long prefix like $__it or something crazy like that... I wish we can name variables using symbols but I don't think this is a thing....
There was a problem hiding this comment.
Consensus from Zoom: We'll keep the current implementation
d5189b6 to
948d0fb
Compare
There was a problem hiding this comment.
all those errors should be more helpful for the user to understand the problem.
something like Possibility of side effect accessing when evaluate ${stringifyExpression(node)}
However, we might want to address this on future PRs
There was a problem hiding this comment.
This only truly becomes relevant when implementing template strings, as any errors thrown in conditions will just treat the condition as "not met" - but the error itself will be swallowed.
I'll see if I can improve it in this PR, or I will defer it till I implement support for template strings.
948d0fb to
625ff93
Compare
Co-authored-by: Idan Shatz <shatzi@gmail.com>
50bb8a6 to
69d6713
Compare
| }) | ||
|
|
||
| it('should report error if condition is invalid', function (done) { | ||
| t.agent.on('debugger-diagnostics', ({ payload }) => { |
There was a problem hiding this comment.
For future reference: using EventEmitter's once() would allow the tests to likely be nicer to read :)
Add support for having a condition on a probe. A condition should return either `true` or `false`. It can however also throw an error. The error can be thrown in two places: 1. When compiling the AST down to the JavaScript source code (an issue was detected at compilation-time) 2. When running the condition in the context of the breakpoint (an issue was detected at run-time) Compilation-time exceptions are reported as an error event on the probe to the DI diagnostics backend. Run-time exceptions are currently just swallowed and the result of the condition is going to be the same as if it evaluated `false` (i.e. it's not going to tigger the breakpoint). To be 100% compatible with how conditions work in the other tracers, we should technically record the run-time errors and expose those to the user (as a help in debugging the condition). However, due to how conditions are implemented in this PR (by using the `condition` property on the `Debugger.setBreakpoint` Chrome DevTools Protocol API), it's not possible to know if a condition failed, or just returned `false`. For now, this is an ok compromise, due to the increased performance gained by using this API.
Add support for having a condition on a probe. A condition should return either `true` or `false`. It can however also throw an error. The error can be thrown in two places: 1. When compiling the AST down to the JavaScript source code (an issue was detected at compilation-time) 2. When running the condition in the context of the breakpoint (an issue was detected at run-time) Compilation-time exceptions are reported as an error event on the probe to the DI diagnostics backend. Run-time exceptions are currently just swallowed and the result of the condition is going to be the same as if it evaluated `false` (i.e. it's not going to tigger the breakpoint). To be 100% compatible with how conditions work in the other tracers, we should technically record the run-time errors and expose those to the user (as a help in debugging the condition). However, due to how conditions are implemented in this PR (by using the `condition` property on the `Debugger.setBreakpoint` Chrome DevTools Protocol API), it's not possible to know if a condition failed, or just returned `false`. For now, this is an ok compromise, due to the increased performance gained by using this API.

What does this PR do?
Add support for having a condition on a probe.
A condition should return either
trueorfalse. It can however also throw an error. The error can be thrown in two places:Compilation-time exceptions are reported as an error event on the probe to the DI diagnostics backend. Run-time exceptions are currently just swallowed and the result of the condition is going to be the same as if it evaluated
false(i.e. it's not going to tigger the breakpoint).To be 100% compatible with how conditions work in the other tracers, we should technically record the run-time errors and expose those to the user (as a help in debugging the condition). However, due to how conditions are implemented in this PR (by using the
conditionproperty on theDebugger.setBreakpointChrome DevTools Protocol API), it's not possible to know if a condition failed, or just returnedfalse.For now, this is an ok compromise, due to the increased performance gained by using this API.
Motivation
Plugin Checklist
Additional Notes