Skip to content

Commit 307d2b4

Browse files
committed
Removed eval
1 parent fcdc7a8 commit 307d2b4

27 files changed

+385
-379
lines changed

dist/hprose-html5.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hprose-html5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hprose-html5.src.js

Lines changed: 190 additions & 187 deletions
Large diffs are not rendered by default.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ gulp.task('concat', ['clear'], function() {
3434
'src/TcpClient.js',
3535
'src/JSONRPCClientFilter.js',
3636
'src/Loader.js'])
37+
.pipe(concat('hprose-html5.src.js'))
3738
.pipe(jshint())
3839
.pipe(jshint.reporter())
39-
.pipe(concat('hprose-html5.src.js'))
4040
.pipe(gulp.dest('dist'));
4141
});
4242

src/APICloudTcpSocket.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
* *
1313
* APICloud tcp socket for HTML5. *
1414
* *
15-
* LastModified: Sep 29, 2016 *
15+
* LastModified: Nov 18, 2016 *
1616
* Author: Ma Bingyao <andot@hprose.com> *
1717
* *
1818
\**********************************************************/
1919

20-
(function (global, undefined) {
20+
(function (hprose, global, undefined) {
2121
'use strict';
2222

23-
var Future = global.hprose.Future;
23+
var Future = hprose.Future;
2424
var atob = global.atob;
2525
var btoa = global.btoa;
26-
var toUint8Array = global.hprose.toUint8Array;
27-
var toBinaryString = global.hprose.toBinaryString;
26+
var toUint8Array = hprose.toUint8Array;
27+
var toBinaryString = hprose.toBinaryString;
2828

2929
function noop(){}
3030

@@ -127,6 +127,6 @@
127127
} }
128128
});
129129

130-
global.hprose.APICloudTcpSocket = APICloudTcpSocket;
130+
hprose.APICloudTcpSocket = APICloudTcpSocket;
131131

132-
})(this || [eval][0]('this'));
132+
})(hprose, hprose.global);

src/Base64.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* *
1313
* Base64 for HTML5. *
1414
* *
15-
* LastModified: Sep 29, 2016 *
15+
* LastModified: Nov 18, 2016 *
1616
* Author: Ma Bingyao <andot@hprose.com> *
1717
* *
1818
\**********************************************************/
@@ -131,4 +131,4 @@
131131
})();
132132
}
133133

134-
})(this || [eval][0]('this'));
134+
})(hprose.global);

src/BytesIO.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
* *
1414
* hprose BytesIO for HTML5. *
1515
* *
16-
* LastModified: Oct 23, 2016 *
16+
* LastModified: Nov 18, 2016 *
1717
* Author: Ma Bingyao <andot@hprose.com> *
1818
* *
1919
\**********************************************************/
2020

21-
(function (global, undefined) {
21+
(function (hprose, undefined) {
2222
'use strict';
2323

24-
var toBinaryString = global.hprose.toBinaryString;
24+
var toBinaryString = hprose.toBinaryString;
2525

2626
var _EMPTY_BYTES = new Uint8Array(0);
2727
var _INIT_SIZE = 1024;
@@ -594,6 +594,6 @@
594594

595595
Object.defineProperty(BytesIO, 'toString', { value: toString });
596596

597-
global.hprose.BytesIO = BytesIO;
597+
hprose.BytesIO = BytesIO;
598598

599-
})(this || [eval][0]('this'));
599+
})(hprose);

src/ChromeTcpSocket.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
* *
1313
* chrome tcp socket for JavaScript. *
1414
* *
15-
* LastModified: Sep 29, 2016 *
15+
* LastModified: Nov 18, 2016 *
1616
* Author: Ma Bingyao <andot@hprose.com> *
1717
* *
1818
\**********************************************************/
1919

20-
(function (global, undefined) {
20+
(function (hprose, global, undefined) {
2121
'use strict';
2222

23-
var Future = global.hprose.Future;
23+
var Future = hprose.Future;
2424

2525
function noop(){}
2626

@@ -176,6 +176,6 @@
176176
} }
177177
});
178178

179-
global.hprose.ChromeTcpSocket = ChromeTcpSocket;
179+
hprose.ChromeTcpSocket = ChromeTcpSocket;
180180

181-
})(this || [eval][0]('this'));
181+
})(hprose, hprose.global);

src/ClassManager.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
* *
1414
* hprose ClassManager for HTML5. *
1515
* *
16-
* LastModified: Sep 29, 2016 *
16+
* LastModified: Nov 18, 2016 *
1717
* Author: Ma Bingyao <andot@hprose.com> *
1818
* *
1919
\**********************************************************/
2020

21-
(function (global) {
21+
(function (hprose, global) {
2222
'use strict';
2323

2424
var WeakMap = global.WeakMap;
@@ -39,14 +39,14 @@
3939
return classCache[alias];
4040
}
4141

42-
global.hprose.ClassManager = Object.create(null, {
42+
hprose.ClassManager = Object.create(null, {
4343
register: { value: register },
4444
getClassAlias: { value: getClassAlias },
4545
getClass: { value: getClass }
4646
});
4747

48-
global.hprose.register = register;
48+
hprose.register = register;
4949

5050
register(Object, 'Object');
5151

52-
})(this || [eval][0]('this'));
52+
})(hprose, hprose.global);

src/Client.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
* *
1313
* hprose client for HTML5. *
1414
* *
15-
* LastModified: Nov 14, 2016 *
15+
* LastModified: Nov 18, 2016 *
1616
* Author: Ma Bingyao <andot@hprose.com> *
1717
* *
1818
\**********************************************************/
1919

20-
(function (global, undefined) {
20+
(function (hprose, global, undefined) {
2121
'use strict';
2222

2323
var setImmediate = global.setImmediate;
24-
var Tags = global.hprose.Tags;
25-
var ResultMode = global.hprose.ResultMode;
26-
var BytesIO = global.hprose.BytesIO;
27-
var Writer = global.hprose.Writer;
28-
var Reader = global.hprose.Reader;
29-
var Future = global.hprose.Future;
30-
var parseuri = global.hprose.parseuri;
31-
var isObjectEmpty = global.hprose.isObjectEmpty;
24+
var Tags = hprose.Tags;
25+
var ResultMode = hprose.ResultMode;
26+
var BytesIO = hprose.BytesIO;
27+
var Writer = hprose.Writer;
28+
var Reader = hprose.Reader;
29+
var Future = hprose.Future;
30+
var parseuri = hprose.parseuri;
31+
var isObjectEmpty = hprose.isObjectEmpty;
3232

3333
var GETFUNCTIONS = new Uint8Array(1);
3434
GETFUNCTIONS[0] = Tags.TagEnd;
@@ -1183,15 +1183,15 @@
11831183

11841184
function create(uri, functions, settings) {
11851185
try {
1186-
return global.hprose.HttpClient.create(uri, functions, settings);
1186+
return hprose.HttpClient.create(uri, functions, settings);
11871187
}
11881188
catch(e) {}
11891189
try {
1190-
return global.hprose.TcpClient.create(uri, functions, settings);
1190+
return hprose.TcpClient.create(uri, functions, settings);
11911191
}
11921192
catch(e) {}
11931193
try {
1194-
return global.hprose.WebSocketClient.create(uri, functions, settings);
1194+
return hprose.WebSocketClient.create(uri, functions, settings);
11951195
}
11961196
catch(e) {}
11971197
if (typeof uri === 'string') {
@@ -1206,6 +1206,6 @@
12061206

12071207
Object.defineProperty(Client, 'create', { value: create });
12081208

1209-
global.hprose.Client = Client;
1209+
hprose.Client = Client;
12101210

1211-
})(this || [eval][0]('this'));
1211+
})(hprose, hprose.global);

0 commit comments

Comments
 (0)