11/*!
2- * Less - Leaner CSS v2.1.0
2+ * Less - Leaner CSS v2.1.1
33 * http://lesscss.org
44 *
55 * Copyright (c) 2009-2014, Alexis Sellier <[email protected] > @@ -2222,7 +2222,7 @@ module.exports = function(environment, fileManagers) {
22222222 var SourceMapOutput , SourceMapBuilder , ParseTree , ImportManager , Environment ;
22232223
22242224 var less = {
2225- version : [ 2 , 1 , 0 ] ,
2225+ version : [ 2 , 1 , 1 ] ,
22262226 data : require ( './data' ) ,
22272227 tree : require ( './tree' ) ,
22282228 Environment : ( Environment = require ( "./environment/environment" ) ) ,
@@ -2233,7 +2233,7 @@ module.exports = function(environment, fileManagers) {
22332233 functions : require ( './functions' ) ( environment ) ,
22342234 contexts : require ( "./contexts" ) ,
22352235 SourceMapOutput : ( SourceMapOutput = require ( './source-map-output' ) ( environment ) ) ,
2236- SourceMapBuilder : ( SourceMapBuilder = require ( './source-map-builder' ) ( SourceMapOutput ) ) ,
2236+ SourceMapBuilder : ( SourceMapBuilder = require ( './source-map-builder' ) ( SourceMapOutput , environment ) ) ,
22372237 ParseTree : ( ParseTree = require ( './parse-tree' ) ( SourceMapBuilder ) ) ,
22382238 ImportManager : ( ImportManager = require ( './import-manager' ) ( environment ) ) ,
22392239 render : require ( "./render" ) ( environment , ParseTree , ImportManager ) ,
@@ -4472,8 +4472,9 @@ module.exports = function(environment, ParseTree, ImportManager) {
44724472 }
44734473
44744474 if ( ! callback ) {
4475+ var self = this ;
44754476 return new PromiseConstructor ( function ( resolve , reject ) {
4476- render ( input , options , function ( err , output ) {
4477+ render . call ( self , input , options , function ( err , output ) {
44774478 if ( err ) {
44784479 reject ( err ) ;
44794480 } else {
@@ -4511,20 +4512,21 @@ module.exports = function(environment, ParseTree, ImportManager) {
45114512 new Parser ( context , imports , rootFileInfo )
45124513 . parse ( input , function ( e , root ) {
45134514 if ( e ) { return callback ( e ) ; }
4515+ var result ;
45144516 try {
45154517 var parseTree = new ParseTree ( root , imports ) ;
4516- var result = parseTree . toCSS ( options ) ;
4517- callback ( null , result ) ;
4518+ result = parseTree . toCSS ( options ) ;
45184519 }
4519- catch ( err ) { callback ( err ) ; }
4520+ catch ( err ) { return callback ( err ) ; }
4521+ callback ( null , result ) ;
45204522 } , options ) ;
45214523 }
45224524 } ;
45234525 return render ;
45244526} ;
45254527
45264528} , { "./contexts" :10 , "./parser/parser" :35 , "./plugin-manager" :36 , "promise" :undefined } ] , 38 :[ function ( require , module , exports ) {
4527- module . exports = function ( SourceMapOutput ) {
4529+ module . exports = function ( SourceMapOutput , environment ) {
45284530
45294531 var SourceMapBuilder = function ( options ) {
45304532 this . options = options ;
@@ -4552,7 +4554,19 @@ module.exports = function (SourceMapOutput) {
45524554 if ( this . options . sourceMapInputFilename ) {
45534555 this . sourceMapInputFilename = sourceMapOutput . normalizeFilename ( this . options . sourceMapInputFilename ) ;
45544556 }
4555- return css ;
4557+ return css + this . getCSSAppendage ( ) ;
4558+ } ;
4559+
4560+ SourceMapBuilder . prototype . getCSSAppendage = function ( ) {
4561+ var sourceMapURL = this . sourceMapURL ;
4562+ if ( this . options . sourceMapFileInline ) {
4563+ sourceMapURL = "data:application/json;base64," + environment . encodeBase64 ( this . sourceMap ) ;
4564+ }
4565+
4566+ if ( sourceMapURL ) {
4567+ return "/*# sourceMappingURL=" + sourceMapURL + " */" ;
4568+ }
4569+ return "" ;
45564570 } ;
45574571
45584572 SourceMapBuilder . prototype . getExternalSourceMap = function ( ) {
@@ -4604,7 +4618,6 @@ module.exports = function (environment) {
46044618 }
46054619 this . _outputSourceFiles = options . outputSourceFiles ;
46064620 this . _sourceMapGeneratorConstructor = environment . getSourceMapGenerator ( ) ;
4607- this . _sourceMapFileInline = options . sourceMapFileInline ;
46084621
46094622 this . _lineNumber = 0 ;
46104623 this . _column = 0 ;
@@ -4711,15 +4724,7 @@ module.exports = function (environment) {
47114724 }
47124725 this . sourceMapURL = sourceMapURL ;
47134726
4714- if ( ! this . _sourceMapFileInline ) {
4715- this . sourceMap = sourceMapContent ;
4716- } else {
4717- sourceMapURL = "data:application/json;base64," + environment . encodeBase64 ( sourceMapContent ) ;
4718- }
4719-
4720- if ( sourceMapURL ) {
4721- this . _css . push ( "/*# sourceMappingURL=" + sourceMapURL + " */" ) ;
4722- }
4727+ this . sourceMap = sourceMapContent ;
47234728 }
47244729
47254730 return this . _css . join ( '' ) ;
@@ -6713,7 +6718,7 @@ var Node = require("./node"),
67136718 Variable = require ( "./variable" ) ;
67146719
67156720var Quoted = function ( str , content , escaped , index , currentFileInfo ) {
6716- this . escaped = escaped ;
6721+ this . escaped = ( escaped == null ) ? true : escaped ;
67176722 this . value = content || '' ;
67186723 this . quote = str . charAt ( 0 ) ;
67196724 this . index = index ;
0 commit comments