Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit eb25452

Browse files
author
Sven Flickinger
committed
make sly compatible with 'use strict' statement
1 parent 2ca7842 commit eb25452

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

scalyr.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* (c) 2013 Scalyr, Inc. http://scalyr.com
44
* License: MIT
55
*/
6+
7+
'use strict';
8+
69
// You may just depend on the 'sly' module to pull in all of the
710
// dependencies.
811
angular.module('sly', ['slyEvaluate', 'slyRepeat']);
@@ -714,12 +717,12 @@ defineScalyrAngularModule('slyRepeat', ['gatedScope'])
714717
defineScalyrAngularModule('gatedScope', [])
715718
.config(['$provide', function($provide) {
716719
// We use a decorator to override methods in $rootScope.
717-
$provide.decorator('$rootScope', ['$delegate', '$exceptionHandler',
720+
$provide.decorator('$rootScope', ['$delegate', '$exceptionHandler',
718721
function ($rootScope, $exceptionHandler) {
719722

720723
// Make a copy of $rootScope's original methods so that we can access
721724
// them to invoke super methods in the ones we override.
722-
scopePrototype = {};
725+
var scopePrototype = {};
723726
for (var key in $rootScope) {
724727
if (isFunction($rootScope[key]))
725728
scopePrototype[key] = $rootScope[key];
@@ -743,7 +746,7 @@ defineScalyrAngularModule('gatedScope', [])
743746
// Because of how scope.$new works, the returned result
744747
// should already have our new methods.
745748
var result = scopePrototype.$new.call(this, isolate);
746-
749+
747750
// We just have to do the work that normally a child class's
748751
// constructor would perform -- initializing our instance vars.
749752
result.$$gatingFunction = this.$$gatingFunction;
@@ -766,7 +769,7 @@ defineScalyrAngularModule('gatedScope', [])
766769
var watch, value,
767770
watchers,
768771
length,
769-
next, current = this, target = this,
772+
next, current = this, target = this, last,
770773
dirty = false;
771774

772775
do { // "traverse the scopes" loop

scripts/includeFiles/header.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* (c) 2013 Scalyr, Inc. http://scalyr.com
44
* License: MIT
55
*/
6+
7+
'use strict';
8+
69
// You may just depend on the 'sly' module to pull in all of the
710
// dependencies.
811
angular.module('sly', ['slyEvaluate', 'slyRepeat']);

src/js/lib/gatedScope.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
defineScalyrAngularModule('gatedScope', [])
1717
.config(['$provide', function($provide) {
1818
// We use a decorator to override methods in $rootScope.
19-
$provide.decorator('$rootScope', ['$delegate', '$exceptionHandler',
19+
$provide.decorator('$rootScope', ['$delegate', '$exceptionHandler',
2020
function ($rootScope, $exceptionHandler) {
2121

2222
// Make a copy of $rootScope's original methods so that we can access
2323
// them to invoke super methods in the ones we override.
24-
scopePrototype = {};
24+
var scopePrototype = {};
2525
for (var key in $rootScope) {
2626
if (isFunction($rootScope[key]))
2727
scopePrototype[key] = $rootScope[key];
@@ -45,7 +45,7 @@ defineScalyrAngularModule('gatedScope', [])
4545
// Because of how scope.$new works, the returned result
4646
// should already have our new methods.
4747
var result = scopePrototype.$new.call(this, isolate);
48-
48+
4949
// We just have to do the work that normally a child class's
5050
// constructor would perform -- initializing our instance vars.
5151
result.$$gatingFunction = this.$$gatingFunction;
@@ -68,7 +68,7 @@ defineScalyrAngularModule('gatedScope', [])
6868
var watch, value,
6969
watchers,
7070
length,
71-
next, current = this, target = this,
71+
next, current = this, target = this, last,
7272
dirty = false;
7373

7474
do { // "traverse the scopes" loop

0 commit comments

Comments
 (0)