From c565a770eb3d1920d960a5962d5dde7c6f3249c8 Mon Sep 17 00:00:00 2001 From: Dmytro Voronkevych Date: Tue, 1 Nov 2022 12:25:00 -0700 Subject: [PATCH] Migrating all qpl.markerAnnotate call sites to the new signature Summary: As part of unifying JS QPL interface, I'm bringing markerAnnotate to the parity with Web version. At the moment it supports only string annotations, but I'm adding support for ints, arrays of ints, arrays of strings, etc. ## Changelog: [Internal] [Changed] - Refactored markerAnnotateWithMap -> markerAnnotate Reviewed By: eddyerburgh Differential Revision: D40796535 fbshipit-source-id: 9831e353036835b97bb7b2f60085016034c04269 --- .../Performance/QuickPerformanceLogger.js | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/Libraries/Performance/QuickPerformanceLogger.js b/Libraries/Performance/QuickPerformanceLogger.js index 5b521eea289..9e8a6cd657c 100644 --- a/Libraries/Performance/QuickPerformanceLogger.js +++ b/Libraries/Performance/QuickPerformanceLogger.js @@ -53,22 +53,6 @@ const QuickPerformanceLogger = { }, markerAnnotate( - markerId: number, - annotationKey: string, - annotationValue: string, - instanceKey: number = DUMMY_INSTANCE_KEY, - ): void { - if (global.nativeQPLMarkerAnnotate) { - global.nativeQPLMarkerAnnotate( - markerId, - instanceKey, - annotationKey, - annotationValue, - ); - } - }, - - markerAnnotateWithMap( markerId: number, annotations: AnnotationsMap, instanceKey: number = DUMMY_INSTANCE_KEY, @@ -76,10 +60,10 @@ const QuickPerformanceLogger = { if (global.nativeQPLMarkerAnnotateWithMap) { global.nativeQPLMarkerAnnotateWithMap(markerId, annotations, instanceKey); } else if (global.nativeQPLMarkerAnnotate) { - for (var type of ['string']) { - var keyValsOfType = annotations[type]; - if (keyValsOfType !== null && keyValsOfType !== undefined) { - for (var annotationKey of Object.keys(keyValsOfType)) { + for (const type of ['string']) { + const keyValsOfType = annotations[type]; + if (keyValsOfType != null) { + for (const annotationKey of Object.keys(keyValsOfType)) { global.nativeQPLMarkerAnnotate( markerId, instanceKey,