From 2a95793de0b3ea316ba0ef3317021404a944259d Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 14 Nov 2017 09:08:04 +0300 Subject: [PATCH] csslint: fix PropertyValuePart.serializeString Two old csslint bugs fixed: * in the absence of capturing groups the replacer function receives the text and index * the actual string "c" should be used to get character codes, not String class --- vendor-overwrites/csslint/csslint-worker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor-overwrites/csslint/csslint-worker.js b/vendor-overwrites/csslint/csslint-worker.js index 535c9570..d3675aa7 100644 --- a/vendor-overwrites/csslint/csslint-worker.js +++ b/vendor-overwrites/csslint/csslint-worker.js @@ -4258,14 +4258,14 @@ PropertyValuePart.parseString = function(str) { * Helper method to serialize a CSS string. */ PropertyValuePart.serializeString = function(value) { - var replacer = function(match, c) { + var replacer = function(c) { if (c === "\"") { return "\\" + c; } - var cp = String.codePointAt ? String.codePointAt(0) : + var cp = String.codePointAt ? c.codePointAt(0) : // We only escape non-surrogate chars, so using charCodeAt // is harmless here. - String.charCodeAt(0); + c.charCodeAt(0); return "\\" + cp.toString(16) + " "; }; return "\"" + value.replace(/["\r\n\f]/g, replacer) + "\"";