11/*!
22CSSLint v0.10.0
3- Copyright (c) 2015 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
3+ Copyright (c) 2016 Nicole Sullivan and Nicholas C. Zakas. All rights reserved.
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the 'Software'), to deal
@@ -6555,10 +6555,9 @@ exports[prop] = parserlib[prop];
65556555}
65566556} ) ( ) ;
65576557
6558+ var clone = ( function ( ) {
65586559'use strict' ;
65596560
6560- var clone = ( function ( global ) {
6561-
65626561/**
65636562 * Clones (copies) an Object using deep copying.
65646563 *
@@ -6577,7 +6576,6 @@ var clone = (function(global) {
65776576 * @param `prototype` - sets the prototype to be used when cloning an object.
65786577 * (optional - defaults to parent prototype).
65796578*/
6580-
65816579function clone ( parent , circular , depth , prototype ) {
65826580 var filter ;
65836581 if ( typeof circular === 'object' ) {
@@ -6614,12 +6612,12 @@ function clone(parent, circular, depth, prototype) {
66146612 return parent ;
66156613 }
66166614
6617- if ( isArray ( parent ) ) {
6615+ if ( clone . __isArray ( parent ) ) {
66186616 child = [ ] ;
6619- } else if ( isRegExp ( parent ) ) {
6620- child = new RegExp ( parent . source , clone . getRegExpFlags ( parent ) ) ;
6617+ } else if ( clone . __isRegExp ( parent ) ) {
6618+ child = new RegExp ( parent . source , __getRegExpFlags ( parent ) ) ;
66216619 if ( parent . lastIndex ) child . lastIndex = parent . lastIndex ;
6622- } else if ( isDate ( parent ) ) {
6620+ } else if ( clone . __isDate ( parent ) ) {
66236621 child = new Date ( parent . getTime ( ) ) ;
66246622 } else if ( useBuffer && Buffer . isBuffer ( parent ) ) {
66256623 child = new Buffer ( parent . length ) ;
@@ -6651,7 +6649,7 @@ function clone(parent, circular, depth, prototype) {
66516649 if ( proto ) {
66526650 attrs = Object . getOwnPropertyDescriptor ( proto , i ) ;
66536651 }
6654-
6652+
66556653 if ( attrs && attrs . set == null ) {
66566654 continue ;
66576655 }
@@ -6671,7 +6669,7 @@ function clone(parent, circular, depth, prototype) {
66716669 * USE WITH CAUTION! This may not behave as you wish if you do not know how this
66726670 * works.
66736671 */
6674- clone . clonePrototype = function ( parent ) {
6672+ clone . clonePrototype = function clonePrototype ( parent ) {
66756673 if ( parent === null )
66766674 return null ;
66776675
@@ -6680,43 +6678,43 @@ clone.clonePrototype = function(parent) {
66806678 return new c ( ) ;
66816679} ;
66826680
6683- function getRegExpFlags ( re ) {
6684- var flags = '' ;
6685- re . global && ( flags += 'g' ) ;
6686- re . ignoreCase && ( flags += 'i' ) ;
6687- re . multiline && ( flags += 'm' ) ;
6688- return flags ;
6689- }
6681+ // private utility functions
66906682
6691- function objectToString ( o ) {
6683+ function __objToStr ( o ) {
66926684 return Object . prototype . toString . call ( o ) ;
6693- }
6685+ } ;
6686+ clone . __objToStr = __objToStr ;
66946687
6695- function isDate ( o ) {
6696- return typeof o === 'object' && objectToString ( o ) === '[object Date]' ;
6697- }
6688+ function __isDate ( o ) {
6689+ return typeof o === 'object' && __objToStr ( o ) === '[object Date]' ;
6690+ } ;
6691+ clone . __isDate = __isDate ;
66986692
6699- function isArray ( o ) {
6700- return typeof o === 'object' && objectToString ( o ) === '[object Array]' ;
6701- }
6693+ function __isArray ( o ) {
6694+ return typeof o === 'object' && __objToStr ( o ) === '[object Array]' ;
6695+ } ;
6696+ clone . __isArray = __isArray ;
67026697
6703- function isRegExp ( o ) {
6704- return typeof o === 'object' && objectToString ( o ) === '[object RegExp]' ;
6705- }
6698+ function __isRegExp ( o ) {
6699+ return typeof o === 'object' && __objToStr ( o ) === '[object RegExp]' ;
6700+ } ;
6701+ clone . __isRegExp = __isRegExp ;
67066702
6707- if ( global . TESTING ) clone . getRegExpFlags = getRegExpFlags ;
6708- if ( global . TESTING ) clone . objectToString = objectToString ;
6709- if ( global . TESTING ) clone . isDate = isDate ;
6710- if ( global . TESTING ) clone . isArray = isArray ;
6711- if ( global . TESTING ) clone . isRegExp = isRegExp ;
6703+ function __getRegExpFlags ( re ) {
6704+ var flags = '' ;
6705+ if ( re . global ) flags += 'g' ;
6706+ if ( re . ignoreCase ) flags += 'i' ;
6707+ if ( re . multiline ) flags += 'm' ;
6708+ return flags ;
6709+ } ;
6710+ clone . __getRegExpFlags = __getRegExpFlags ;
67126711
67136712return clone ;
6713+ } ) ( ) ;
67146714
6715- } ) ( typeof ( global ) === 'object' ? global :
6716- typeof ( window ) === 'object' ? window : this ) ;
6717-
6718- if ( module && module . exports )
6715+ if ( typeof module === 'object' && module . exports ) {
67196716 module . exports = clone ;
6717+ }
67206718
67216719/**
67226720 * Main CSSLint object.
0 commit comments