From a538f7a07107056eb831bece80263de4b6bbe24d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 31 May 2017 20:47:17 -0400 Subject: [PATCH] update tests to use new assign helper --- .../collapses-text-around-comments/_actual-bundle.js | 7 ++++--- .../collapses-text-around-comments/expected-bundle.js | 7 ++++--- test/js/samples/computed-collapsed-if/_actual-bundle.js | 7 ++++--- test/js/samples/computed-collapsed-if/expected-bundle.js | 7 ++++--- test/js/samples/each-block-changed-check/_actual-bundle.js | 7 ++++--- .../js/samples/each-block-changed-check/expected-bundle.js | 7 ++++--- test/js/samples/event-handlers-custom/_actual-bundle.js | 7 ++++--- test/js/samples/event-handlers-custom/expected-bundle.js | 7 ++++--- test/js/samples/if-block-no-update/_actual-bundle.js | 7 ++++--- test/js/samples/if-block-no-update/expected-bundle.js | 7 ++++--- test/js/samples/if-block-simple/_actual-bundle.js | 7 ++++--- test/js/samples/if-block-simple/expected-bundle.js | 7 ++++--- test/js/samples/non-imported-component/_actual-bundle.js | 7 ++++--- test/js/samples/non-imported-component/expected-bundle.js | 7 ++++--- .../onrender-onteardown-rewritten/_actual-bundle.js | 7 ++++--- .../onrender-onteardown-rewritten/expected-bundle.js | 7 ++++--- test/js/samples/use-elements-as-anchors/_actual-bundle.js | 7 ++++--- test/js/samples/use-elements-as-anchors/expected-bundle.js | 7 ++++--- 18 files changed, 72 insertions(+), 54 deletions(-) diff --git a/test/js/samples/collapses-text-around-comments/_actual-bundle.js b/test/js/samples/collapses-text-around-comments/_actual-bundle.js index 6372e1ef4f..669f13d791 100644 --- a/test/js/samples/collapses-text-around-comments/_actual-bundle.js +++ b/test/js/samples/collapses-text-around-comments/_actual-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/collapses-text-around-comments/expected-bundle.js b/test/js/samples/collapses-text-around-comments/expected-bundle.js index 6372e1ef4f..669f13d791 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/computed-collapsed-if/_actual-bundle.js b/test/js/samples/computed-collapsed-if/_actual-bundle.js index 65a703f19b..f3719a18af 100644 --- a/test/js/samples/computed-collapsed-if/_actual-bundle.js +++ b/test/js/samples/computed-collapsed-if/_actual-bundle.js @@ -1,9 +1,10 @@ function noop () {} function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 65a703f19b..f3719a18af 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -1,9 +1,10 @@ function noop () {} function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/each-block-changed-check/_actual-bundle.js b/test/js/samples/each-block-changed-check/_actual-bundle.js index 95a876bad5..2c7ba6db88 100644 --- a/test/js/samples/each-block-changed-check/_actual-bundle.js +++ b/test/js/samples/each-block-changed-check/_actual-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/each-block-changed-check/expected-bundle.js b/test/js/samples/each-block-changed-check/expected-bundle.js index 95a876bad5..2c7ba6db88 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/event-handlers-custom/_actual-bundle.js b/test/js/samples/event-handlers-custom/_actual-bundle.js index 7fae3fe412..3680d44d25 100644 --- a/test/js/samples/event-handlers-custom/_actual-bundle.js +++ b/test/js/samples/event-handlers-custom/_actual-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 7fae3fe412..3680d44d25 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/if-block-no-update/_actual-bundle.js b/test/js/samples/if-block-no-update/_actual-bundle.js index 29b6104b9b..781adc2850 100644 --- a/test/js/samples/if-block-no-update/_actual-bundle.js +++ b/test/js/samples/if-block-no-update/_actual-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/if-block-no-update/expected-bundle.js b/test/js/samples/if-block-no-update/expected-bundle.js index 29b6104b9b..781adc2850 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/if-block-simple/_actual-bundle.js b/test/js/samples/if-block-simple/_actual-bundle.js index 0998c38be3..67abd439bb 100644 --- a/test/js/samples/if-block-simple/_actual-bundle.js +++ b/test/js/samples/if-block-simple/_actual-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 0998c38be3..67abd439bb 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/non-imported-component/_actual-bundle.js b/test/js/samples/non-imported-component/_actual-bundle.js index 3f8554332a..b0995e4498 100644 --- a/test/js/samples/non-imported-component/_actual-bundle.js +++ b/test/js/samples/non-imported-component/_actual-bundle.js @@ -1,9 +1,10 @@ import Imported from 'Imported.html'; function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index 3f8554332a..b0995e4498 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -1,9 +1,10 @@ import Imported from 'Imported.html'; function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/onrender-onteardown-rewritten/_actual-bundle.js b/test/js/samples/onrender-onteardown-rewritten/_actual-bundle.js index 424d82b761..4c035dc8fa 100644 --- a/test/js/samples/onrender-onteardown-rewritten/_actual-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/_actual-bundle.js @@ -1,9 +1,10 @@ function noop () {} function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js index 424d82b761..4c035dc8fa 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js @@ -1,9 +1,10 @@ function noop () {} function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/use-elements-as-anchors/_actual-bundle.js b/test/js/samples/use-elements-as-anchors/_actual-bundle.js index 4cc501c982..5277d03f53 100644 --- a/test/js/samples/use-elements-as-anchors/_actual-bundle.js +++ b/test/js/samples/use-elements-as-anchors/_actual-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; diff --git a/test/js/samples/use-elements-as-anchors/expected-bundle.js b/test/js/samples/use-elements-as-anchors/expected-bundle.js index 4cc501c982..5277d03f53 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -1,7 +1,8 @@ function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target;