From 3e75ea282123c62eb8cebef0b9741b482da20906 Mon Sep 17 00:00:00 2001 From: schneems Date: Tue, 14 Nov 2017 16:19:18 -0600 Subject: [PATCH] Index into `source` instead of `buf` So we can take advantage of the UTF32 encoding. --- lib/sprockets/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sprockets/utils.rb b/lib/sprockets/utils.rb index 1233b78f7..bb0c68d71 100644 --- a/lib/sprockets/utils.rb +++ b/lib/sprockets/utils.rb @@ -106,7 +106,7 @@ def concat_javascript_sources(buf, source) source = source.encode(Encoding::UTF_32LE) unless source.ascii_only? return buf if string_end_with_semicolon?(source) - if whitespace = WHITESPACE_ORDINALS[buf[-1].ord] + if whitespace = WHITESPACE_ORDINALS[source[-1].ord] buf[-1] = ";#{whitespace}" else buf << ";"