MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / parse

Method parse

packages/core/ui/styling/style-scope.ts:216–238  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214
215 @profile
216 private parse(): void {
217 try {
218 if (!this._ast) {
219 if (!this._source && this._file) {
220 this.load();
221 }
222 // [object Object] check guards against empty app.css file
223 if (this._source && this.source !== '[object Object]') {
224 this.parseCSSAst();
225 }
226 }
227 if (this._ast) {
228 this.createSelectorsAndKeyframes();
229 } else {
230 this._selectors = [];
231 }
232 } catch (e) {
233 if (Trace.isEnabled()) {
234 Trace.write('Css styling failed: ' + e, Trace.categories.Style, Trace.messageType.error);
235 }
236 this._selectors = [];
237 }
238 }
239
240 @profile
241 private async parseCSSAst() {

Callers 1

constructorMethod · 0.95

Calls 5

loadMethod · 0.95
parseCSSAstMethod · 0.95
isEnabledMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected