Skip to content

Commit 16a280b

Browse files
authored
Revert "Transpile to ES6"
1 parent 60f842b commit 16a280b

File tree

18 files changed

+47
-230
lines changed

18 files changed

+47
-230
lines changed

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ results
2929
scratch/
3030
.idea/
3131
.settings/
32-
.vscode/**
33-
!.vscode/launch.json
32+
.vscode/
3433
test-reports.xml
3534

3635
npm-debug.log
3736
node_modules
38-
docs/html
39-
40-
!test-scripts/*.js
37+
docs/html

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ lib/**/*.ts
2121
lib/**/*.js.map
2222

2323
test/
24-
test-scripts/
2524
.vscode
2625
lib/common/test/
2726
coverage/
2827
scratch/
2928
*.suo
3029
.travis.yml
3130
docs/html/
32-
dev/
31+
dev/

.vscode/launch.json

Lines changed: 0 additions & 70 deletions
This file was deleted.

Gruntfile.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ module.exports = function(grunt) {
2828

2929
pkg: grunt.file.readJSON("package.json"),
3030
ts: {
31-
options: grunt.file.readJSON("tsconfig.json").compilerOptions,
31+
options: {
32+
target: 'es5',
33+
module: 'commonjs',
34+
sourceMap: true,
35+
declaration: false,
36+
removeComments: false,
37+
noImplicitAny: true,
38+
experimentalDecorators: true
39+
},
3240

3341
devlib: {
3442
src: ["lib/**/*.ts", "!lib/common/node_modules/**/*.ts"],
@@ -123,17 +131,7 @@ module.exports = function(grunt) {
123131
},
124132

125133
clean: {
126-
src: ["test/**/*.js*",
127-
"lib/**/*.js*",
128-
"!test-scripts/**/*",
129-
"!lib/common/vendor/*.js",
130-
"!lib/common/**/*.json",
131-
"!lib/common/Gruntfile.js",
132-
"!lib/common/node_modules/**/*",
133-
"!lib/common/hooks/**/*.js",
134-
"!lib/common/bin/*.js",
135-
"!lib/common/test-scripts/**/*",
136-
"*.tgz"]
134+
src: ["test/**/*.js*", "lib/**/*.js*", "!lib/common/vendor/*.js", "!lib/common/**/*.json", "!lib/common/Gruntfile.js", "!lib/common/node_modules/**/*", "!lib/common/hooks/**/*.js", "!lib/common/bin/*.js", "*.tgz"]
137135
}
138136
});
139137

bin/nativescript

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
11
#!/bin/sh
22

33
AB_DIR="`dirname \"$0\"`"
4-
NODE_VERSION=`node --version`
5-
NODE4_VERSION_PREFIX="v4."
6-
NODE5_VERSION_PREFIX="v5."
7-
8-
# check if Node.js version is 4.x.x or 5.x.x - both of them do not support some of required features
9-
# so we have to pass --harmony flag for them in order to enable spread opearator usage
10-
# Use POSIX substring parameter expansion, so the code will work on all shells.
11-
12-
if [ "${NODE_VERSION#$NODE4_VERSION_PREFIX*}" != "$NODE_VERSION" -o "${NODE_VERSION#$NODE5_VERSION_PREFIX*}" != "$NODE_VERSION" ]
13-
then
14-
# Node is 4.x.x or 5.x.x
15-
node --harmony "$AB_DIR/nativescript.js" "$@"
16-
else
17-
# Node is NOT 4.x.x or 5.x.x
18-
node "$AB_DIR/nativescript.js" "$@"
19-
fi
4+
node "$AB_DIR/nativescript.js" "$@"

bin/nativescript.cmd

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1 @@
1-
@for /F "delims=" %%i IN ('@node --version') DO @set node_ver=%%i
2-
3-
@echo %node_ver% | @findstr /b /c:"v4."
4-
@set is_node_4=%errorlevel%
5-
6-
@echo %node_ver% | @findstr /b /c:"v5."
7-
@set is_node_5=%errorlevel%
8-
9-
@set use_harmony_flag=0
10-
11-
@if %is_node_4% == 0 @set use_harmony_flag=1
12-
@if %is_node_5% == 0 @set use_harmony_flag=1
13-
14-
@if %use_harmony_flag% == 1 (
15-
return @node --harmony %~dp0\nativescript.js %*
16-
) else (
17-
@node %~dp0\nativescript.js %*
18-
)
1+
@node %~dp0\nativescript.js %*

bin/tns

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
11
#!/bin/sh
22

33
AB_DIR="`dirname \"$0\"`"
4-
NODE_VERSION=`node --version`
5-
NODE4_VERSION_PREFIX="v4."
6-
NODE5_VERSION_PREFIX="v5."
7-
8-
# check if Node.js version is 4.x.x or 5.x.x - both of them do not support some of required features
9-
# so we have to pass --harmony flag for them in order to enable spread opearator usage
10-
# Use POSIX substring parameter expansion, so the code will work on all shells.
11-
12-
if [ "${NODE_VERSION#$NODE4_VERSION_PREFIX*}" != "$NODE_VERSION" -o "${NODE_VERSION#$NODE5_VERSION_PREFIX*}" != "$NODE_VERSION" ]
13-
then
14-
# Node is 4.x.x or 5.x.x
15-
node --harmony "$AB_DIR/nativescript.js" "$@"
16-
else
17-
# Node is NOT 4.x.x or 5.x.x
18-
node "$AB_DIR/nativescript.js" "$@"
19-
fi
4+
node "$AB_DIR/nativescript.js" "$@"

bin/tns.cmd

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1 @@
1-
@for /F "delims=" %%i IN ('@node --version') DO @set node_ver=%%i
2-
3-
@echo %node_ver% | @findstr /b /c:"v4."
4-
@set is_node_4=%errorlevel%
5-
6-
@echo %node_ver% | @findstr /b /c:"v5."
7-
@set is_node_5=%errorlevel%
8-
9-
@set use_harmony_flag=0
10-
11-
@if %is_node_4% == 0 @set use_harmony_flag=1
12-
@if %is_node_5% == 0 @set use_harmony_flag=1
13-
14-
@if %use_harmony_flag% == 1 (
15-
return @node --harmony %~dp0\nativescript.js %*
16-
) else (
17-
@node %~dp0\nativescript.js %*
18-
)
1+
@node %~dp0\nativescript.js %*

lib/device-sockets/ios/socket-request-executor.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ export class IOSSocketRequestExecutor implements IiOSSocketRequestExecutor {
1313
return (() => {
1414
let npc = new iOSProxyServices.NotificationProxyClient(device, this.$injector);
1515

16-
let data = [this.$iOSNotification.alreadyConnected, this.$iOSNotification.readyForAttach, this.$iOSNotification.attachAvailable]
17-
.map((notification) => this.$iOSNotificationService.awaitNotification(npc, notification, timeout)),
18-
alreadyConnected = data[0],
19-
readyForAttach = data[1],
20-
attachAvailable = data[2];
16+
let [alreadyConnected, readyForAttach, attachAvailable] = [this.$iOSNotification.alreadyConnected, this.$iOSNotification.readyForAttach, this.$iOSNotification.attachAvailable]
17+
.map((notification) => this.$iOSNotificationService.awaitNotification(npc, notification, timeout));
2118

2219
npc.postNotificationAndAttachForData(this.$iOSNotification.attachAvailabilityQuery);
2320

0 commit comments

Comments
 (0)