@@ -128,8 +128,8 @@ String rawRtiToJsConstructorName(Object rti) {
128128/// Given a raw constructor name, return the unminified name, if available,
129129/// otherwise tag the name with `minified:` .
130130String unminifyOrTag (String rawClassName) {
131- String preserved = unmangleGlobalNameIfPreservedAnyways (rawClassName);
132- if (preserved is String ) return preserved;
131+ String ? preserved = unmangleGlobalNameIfPreservedAnyways (rawClassName);
132+ if (preserved != null ) return preserved;
133133 if (JS_GET_FLAG ('MINIFIED' )) return 'minified:${rawClassName }' ;
134134 return rawClassName;
135135}
@@ -398,7 +398,7 @@ class JSInvocationMirror implements Invocation {
398398
399399class Primitives {
400400 static int objectHashCode (object) {
401- int hash = JS ('int|Null' , r'#.$identityHash' , object);
401+ int ? hash = JS ('int|Null' , r'#.$identityHash' , object);
402402 if (hash == null ) {
403403 hash = JS ('int' , '(Math.random() * 0x3fffffff) | 0' );
404404 JS ('void' , r'#.$identityHash = #' , object, hash);
@@ -786,7 +786,7 @@ class Primitives {
786786 // Example: "Wed May 16 2012 21:13:00 GMT+0200 (CEST)".
787787 // We extract this name using a regexp.
788788 var d = lazyAsJsDate (receiver);
789- List match = JS ('JSArray|Null' , r'/\((.*)\)/.exec(#.toString())' , d);
789+ List ? match = JS ('JSArray|Null' , r'/\((.*)\)/.exec(#.toString())' , d);
790790 if (match != null ) return match[1 ];
791791
792792 // Internet Explorer 10+ emits the zone name without parenthesis:
@@ -1575,7 +1575,7 @@ class TypeErrorDecoder {
15751575 // Look for the special pattern \$camelCase\$ (all the $ symbols
15761576 // have been escaped already), as we will soon be inserting
15771577 // regular expression syntax that we want interpreted by RegExp.
1578- List <String > match =
1578+ List <String >? match =
15791579 JS ('JSExtendableArray|Null' , r'#.match(/\\\$[a-zA-Z]+\\\$/g)' , message);
15801580 if (match == null ) match = [];
15811581
@@ -1926,7 +1926,7 @@ unwrapException(ex) {
19261926 return ex;
19271927}
19281928
1929- String tryStringifyException (ex) {
1929+ String ? tryStringifyException (ex) {
19301930 // Since this function is called from [unwrapException] which is called from
19311931 // code injected into a catch-clause, use JavaScript try-catch to avoid a
19321932 // potential loop if stringifying crashes.
@@ -1950,7 +1950,7 @@ StackTrace getTraceFromException(exception) {
19501950 return exception.stackTrace;
19511951 }
19521952 if (exception == null ) return new _StackTrace (exception);
1953- _StackTrace trace = JS ('_StackTrace|Null' , r'#.$cachedTrace' , exception);
1953+ _StackTrace ? trace = JS ('_StackTrace|Null' , r'#.$cachedTrace' , exception);
19541954 if (trace != null ) return trace;
19551955 trace = new _StackTrace (exception);
19561956 return JS ('_StackTrace' , r'#.$cachedTrace = #' , exception, trace);
@@ -2095,7 +2095,7 @@ abstract class Closure implements Function {
20952095 static fromTearOff (
20962096 receiver,
20972097 List functions,
2098- int applyTrampolineIndex,
2098+ int ? applyTrampolineIndex,
20992099 var reflectionInfo,
21002100 bool isStatic,
21012101 bool isIntercepted,
@@ -2116,8 +2116,8 @@ abstract class Closure implements Function {
21162116 // TODO(ahe): All the place below using \$ should be rewritten to go
21172117 // through the namer.
21182118 var function = JS ('' , '#[#]' , functions, 0 );
2119- String name = JS ('String|Null' , '#.\$ stubName' , function);
2120- String callName = JS ('String|Null' , '#[#]' , function,
2119+ String ? name = JS ('String|Null' , '#.\$ stubName' , function);
2120+ String ? callName = JS ('String|Null' , '#[#]' , function,
21212121 JS_GET_NAME (JsGetName .CALL_NAME_PROPERTY ));
21222122
21232123 // This variable holds either an index into the types-table, or a function
@@ -2301,7 +2301,7 @@ abstract class Closure implements Function {
23012301 }
23022302
23032303 static cspForwardCall (
2304- int arity, bool isSuperCall, String stubName, function) {
2304+ int arity, bool isSuperCall, String ? stubName, function) {
23052305 var getSelf = RAW_DART_FUNCTION_REF (BoundClosure .selfOf);
23062306 // Handle intercepted stub-names with the default slow case.
23072307 if (isSuperCall) arity = - 1 ;
@@ -2383,7 +2383,7 @@ abstract class Closure implements Function {
23832383
23842384 static forwardCallTo (receiver, function, bool isIntercepted) {
23852385 if (isIntercepted) return forwardInterceptedCallTo (receiver, function);
2386- String stubName = JS ('String|Null' , '#.\$ stubName' , function);
2386+ String ? stubName = JS ('String|Null' , '#.\$ stubName' , function);
23872387 int arity = JS ('int' , '#.length' , function);
23882388 var lookedUpFunction = JS ('' , '#[#]' , receiver, stubName);
23892389 // The receiver[stubName] may not be equal to the function if we try to
@@ -2420,7 +2420,7 @@ abstract class Closure implements Function {
24202420 }
24212421
24222422 static cspForwardInterceptedCall (
2423- int arity, bool isSuperCall, String name, function) {
2423+ int arity, bool isSuperCall, String ? name, function) {
24242424 var getSelf = RAW_DART_FUNCTION_REF (BoundClosure .selfOf);
24252425 var getReceiver = RAW_DART_FUNCTION_REF (BoundClosure .receiverOf);
24262426 // Handle intercepted stub-names with the default slow case.
@@ -2515,7 +2515,7 @@ abstract class Closure implements Function {
25152515 static forwardInterceptedCallTo (receiver, function) {
25162516 String selfField = BoundClosure .selfFieldName ();
25172517 String receiverField = BoundClosure .receiverFieldName ();
2518- String stubName = JS ('String|Null' , '#.\$ stubName' , function);
2518+ String ? stubName = JS ('String|Null' , '#.\$ stubName' , function);
25192519 int arity = JS ('int' , '#.length' , function);
25202520 bool isCsp = JS_GET_FLAG ('USE_CONTENT_SECURITY_POLICY' );
25212521 var lookedUpFunction = JS ('' , '#[#]' , receiver, stubName);
@@ -2587,7 +2587,7 @@ abstract class TearOffClosure extends Closure {}
25872587
25882588class StaticClosure extends TearOffClosure {
25892589 String toString () {
2590- String name =
2590+ String ? name =
25912591 JS ('String|Null' , '#[#]' , this , STATIC_FUNCTION_NAME_PROPERTY_NAME );
25922592 if (name == null ) return 'Closure of unknown static method' ;
25932593 return "Closure '${unminifyOrTag (name )}'" ;
@@ -3241,7 +3241,7 @@ Future<Null> loadDeferredLibrary(String loadId) {
32413241 // by an index. There are two arrays, one that maps the index into a Uri and
32423242 // another that maps the index to a hash.
32433243 var partsMap = JS_EMBEDDED_GLOBAL ('' , DEFERRED_LIBRARY_PARTS );
3244- List indexes = JS ('JSExtendableArray|Null' , '#[#]' , partsMap, loadId);
3244+ List ? indexes = JS ('JSExtendableArray|Null' , '#[#]' , partsMap, loadId);
32453245 if (indexes == null ) return new Future .value (null );
32463246 List <String > uris = < String > [];
32473247 List <String > hashes = < String > [];
@@ -3323,7 +3323,7 @@ String? _cspNonce = _computeCspNonce();
33233323String ? _computeCspNonce () {
33243324 var currentScript = JS_EMBEDDED_GLOBAL ('' , CURRENT_SCRIPT );
33253325 if (currentScript == null ) return null ;
3326- String nonce = JS ('String|Null' , '#.nonce' , currentScript);
3326+ String ? nonce = JS ('String|Null' , '#.nonce' , currentScript);
33273327 return (nonce != null && nonce != '' )
33283328 ? nonce
33293329 : JS ('String|Null' , '#.getAttribute("nonce")' , currentScript);
0 commit comments