| OLD | NEW |
| 1 var initialize_SassTest = function() { | 1 var initialize_SassTest = function() { |
| 2 | 2 |
| 3 InspectorTest.preloadModule("sass"); | 3 InspectorTest.preloadModule("sass"); |
| 4 | 4 |
| 5 var cssParserService = null; | 5 var cssParserService = null; |
| 6 | 6 |
| 7 InspectorTest.cssParserService = function() | 7 InspectorTest.cssParserService = function() |
| 8 { | 8 { |
| 9 if (!cssParserService) | 9 if (!cssParserService) |
| 10 cssParserService = new WebInspector.CSSParserService(); | 10 cssParserService = new WebInspector.CSSParserService(); |
| 11 return cssParserService; | 11 return cssParserService; |
| 12 } | 12 } |
| 13 | 13 |
| 14 var sassSourceMapFactory = null; | 14 var sassSourceMapFactory = null; |
| 15 InspectorTest.sassSourceMapFactory = function() | 15 InspectorTest.sassSourceMapFactory = function() |
| 16 { | 16 { |
| 17 if (!sassSourceMapFactory) | 17 if (!sassSourceMapFactory) |
| 18 sassSourceMapFactory = new WebInspector.SASSSourceMapFactory(); | 18 sassSourceMapFactory = new WebInspector.SASSSourceMapFactory(); |
| 19 return sassSourceMapFactory; | 19 return sassSourceMapFactory; |
| 20 } | 20 } |
| 21 | 21 |
| 22 InspectorTest.parseCSS = function(url, text) | 22 InspectorTest.parseCSS = function(url, text) |
| 23 { | 23 { |
| 24 return WebInspector.SASSSupport.parseCSS(url, text); | 24 return WebInspector.SASSSupport.parseCSS(url, text); |
| 25 } | 25 } |
| 26 | 26 |
| 27 InspectorTest.parseSCSS = function(url, text) | 27 InspectorTest.parseSCSS = function(url, text) |
| 28 { | 28 { |
| 29 return self.runtime.instancePromise(WebInspector.TokenizerFactory) | 29 return WebInspector.SASSSupport.parseSCSS(url, text); |
| 30 .then(onTokenizer); | |
| 31 | |
| 32 function onTokenizer(tokenizer) | |
| 33 { | |
| 34 return WebInspector.SASSSupport.parseSCSS(tokenizer, url, text); | |
| 35 } | |
| 36 } | 30 } |
| 37 | 31 |
| 38 InspectorTest.loadASTMapping = function(header, callback) | 32 InspectorTest.loadASTMapping = function(header, callback) |
| 39 { | 33 { |
| 40 var completeSourceMapURL = WebInspector.ParsedURL.completeURL(header.sourceU
RL, header.sourceMapURL); | 34 var completeSourceMapURL = WebInspector.ParsedURL.completeURL(header.sourceU
RL, header.sourceMapURL); |
| 41 WebInspector.TextSourceMap.load(completeSourceMapURL, header.sourceURL).then
(onSourceMapLoaded); | 35 WebInspector.TextSourceMap.load(completeSourceMapURL, header.sourceURL).then
(onSourceMapLoaded); |
| 42 | 36 |
| 43 function onSourceMapLoaded(sourceMap) | 37 function onSourceMapLoaded(sourceMap) |
| 44 { | 38 { |
| 45 InspectorTest.sassSourceMapFactory().editableSourceMap(header.cssModel()
.target(), sourceMap) | 39 InspectorTest.sassSourceMapFactory().editableSourceMap(header.cssModel()
.target(), sourceMap) |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 304 } |
| 311 if (!match) | 305 if (!match) |
| 312 return null; | 306 return null; |
| 313 var sourceRange = new WebInspector.SourceRange(match.index, match[0].length)
; | 307 var sourceRange = new WebInspector.SourceRange(match.index, match[0].length)
; |
| 314 var textRange = sourceRange.toTextRange(new WebInspector.Text(source)); | 308 var textRange = sourceRange.toTextRange(new WebInspector.Text(source)); |
| 315 return new WebInspector.SourceEdit("", textRange, newText); | 309 return new WebInspector.SourceEdit("", textRange, newText); |
| 316 } | 310 } |
| 317 | 311 |
| 318 } | 312 } |
| 319 | 313 |
| OLD | NEW |