Skip to content
Permalink
Browse files
CSS: Don't name the anonymous swap function
IE8 doesn't like named anonymous expressions. Not naming the function
expression reduces the gzipped size by 5 bytes.

In ECMAScript 2015 the function will get the name inferred from the
variable name (here: swap) anyway.

Refs 02a9d9f
  • Loading branch information
mgol committed Jun 1, 2015
1 parent 8bf81d7 commit e847574fc755b5339f3de41bcebd5b2a3e140cfe
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/css/var/swap.js
@@ -1,7 +1,7 @@
define(function() {

// A method for quickly swapping in/out CSS properties to get correct calculations.
return function swap( elem, options, callback, args ) {
return function( elem, options, callback, args ) {
var ret, name,
old = {};

1 comment on commit e847574

@timmywil

This comment has been minimized.

Copy link
Member

@timmywil timmywil commented on e847574 Jun 1, 2015

Nice catch.

Please sign in to comment.