@@ -107,4 +107,53 @@ class DartRuntimeDebugger {
107
107
// Use the helper method to wrap this in an IIFE
108
108
return _wrapInIIFE (expression);
109
109
}
110
+
111
+ /// Generates a JS expression for retrieving extension names.
112
+ String getExtensionNamesJsExpression () {
113
+ return _generateJsExpression (
114
+ "${_loadStrategy .loadModuleSnippet }('dart_sdk').developer._extensions.keys.toList();" ,
115
+ 'dartDevEmbedder.debugger.extensionNames' ,
116
+ );
117
+ }
118
+
119
+ /// Generates a JS expression for retrieving library metadata.
120
+ String getLibraryMetadataJsExpression (String libraryUri) {
121
+ final expression = _buildExpression (
122
+ '' ,
123
+ "getLibraryMetadata('$libraryUri ')" ,
124
+ "getClassesInLibrary('$libraryUri ')" ,
125
+ );
126
+ // Use the helper method to wrap this in an IIFE
127
+ return _wrapInIIFE (expression);
128
+ }
129
+
130
+ /// Generates a JS expression for retrieving map elements.
131
+ String getMapElementsJsExpression () {
132
+ return _buildExpression (
133
+ '' ,
134
+ 'getMapElements(this)' ,
135
+ 'getMapElements(this)' ,
136
+ );
137
+ }
138
+
139
+ /// Generates a JS expression for dynamically loading an object's field.
140
+ String dloadReplJsExpression (String fieldName) {
141
+ return _generateJsExpression (
142
+ _wrapWithSdkLoader ('' , 'dloadRepl(this, "$fieldName ")' ),
143
+ '''
144
+ function() {
145
+ return this["$fieldName "];
146
+ }
147
+ ''' ,
148
+ );
149
+ }
150
+
151
+ /// Generates a JS expression for retrieving set elements.
152
+ String getSetElementsJsExpression () {
153
+ return _buildExpression (
154
+ '' ,
155
+ 'getSetElements(this)' ,
156
+ 'getSetElements(this)' ,
157
+ );
158
+ }
110
159
}
0 commit comments