Skip to content

Commit af7f639

Browse files
srujzsCommit Queue
authored andcommitted
Change void_return_test to not use eval
eval is disallowed by CSP and the dart2js-minified-csp-linux-chrome bot is currently red. This uses Math.max, which should be available both on d8 and with CSP enabled. Change-Id: I5e348a72d50cf10db713934151473f0d15782ba3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421502 Commit-Queue: Ömer Ağacan <[email protected]> Auto-Submit: Srujan Gaddam <[email protected]> Reviewed-by: Ömer Ağacan <[email protected]>
1 parent edde813 commit af7f639

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/lib/js/static_interop_test/void_return_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import 'dart:js_interop';
88

9-
@JS()
10-
external void eval(String code);
9+
@JS('Math.max')
10+
external void max(int a, int b);
1111

1212
void main() {
13-
Object? x = eval('1 + 1') as dynamic;
13+
Object? x = max(1, 2) as dynamic;
1414

1515
// It doesn't matter what this prints, it just shouldn't crash.
1616
print(x);

0 commit comments

Comments
 (0)