From 66caf45e0b152c14bcec5a24e5a31ca75fe4ea73 Mon Sep 17 00:00:00 2001 From: "Eevee (Alex Munroe)" Date: Sun, 31 Aug 2014 19:02:48 -0700 Subject: Preserve the order of slurpy kwargs. Fix a heisentest. --- scss/compiler.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scss/compiler.py') diff --git a/scss/compiler.py b/scss/compiler.py index c941e2c..6304a3c 100644 --- a/scss/compiler.py +++ b/scss/compiler.py @@ -13,6 +13,12 @@ import re import sys import warnings +try: + from collections import OrderedDict +except ImportError: + # Backport + from ordereddict import OrderedDict + import six import scss.config as config @@ -574,7 +580,7 @@ class Compilation(object): def _populate_namespace_from_call(self, name, callee_namespace, mixin, args, kwargs): # Mutation protection args = list(args) - kwargs = dict(kwargs) + kwargs = OrderedDict(kwargs) #m_params = mixin[0] #m_defaults = mixin[1] @@ -665,7 +671,7 @@ class Compilation(object): # TODO CallOp converts Sass names to Python names, so we # have to convert them back to Sass names. would be nice # to avoid this back-and-forth somehow - kwargs = dict( + kwargs = OrderedDict( (normalize_var('$' + key), value) for (key, value) in kwargs.items()) -- cgit v1.2.1