Skip to content

Fix support for Node.js 4 #2414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2017

Conversation

rosen-vladimirov
Copy link
Contributor

As the code is transpiled to ES6, spread operator from TypeScript is transpiled to spread operator in JavaScript.
However this usage is not available in Node.js 4:

let { normalizedPropertyName, projectConfigurations } = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations);

// Replaced with:
let data = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations),
	normalizedPropertyName = data.normalizedPropertyName,
	projectConfigurations = data.projectConfigurations;

This is limitation of Node.js 4 itself. Spread operator is not available there (it's available only for arrays, i.e.

const arr = [ 1, 2, 3 ]
console.log([ 0, ...arr ]);
	[ 0, 1, 2, 3 ]

As the code is transpiled to ES6, spread operator from TypeScript is transpiled to spread operator in JavaScript.
However this usage is not available in Node.js 4:
```TypeScript
let { normalizedPropertyName, projectConfigurations } = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations);

// Replaced with:
let data = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations),
	normalizedPropertyName = data.normalizedPropertyName,
	projectConfigurations = data.projectConfigurations;
```

This is limitation of Node.js 4 itself. Spread operator is not available there (it's available only for arrays, i.e.
```JavaScript
const arr = [ 1, 2, 3 ]
console.log([ 0, ...arr ]);
	[ 0, 1, 2, 3 ]
```
@rosen-vladimirov rosen-vladimirov merged commit cc3580f into master Jan 12, 2017
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/support-node-4-provision branch January 12, 2017 15:53
TomaNikolov pushed a commit that referenced this pull request Jan 26, 2017
As the code is transpiled to ES6, spread operator from TypeScript is transpiled to spread operator in JavaScript.
However this usage is not available in Node.js 4:
```TypeScript
let { normalizedPropertyName, projectConfigurations } = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations);

// Replaced with:
let data = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations),
	normalizedPropertyName = data.normalizedPropertyName,
	projectConfigurations = data.projectConfigurations;
```

This is limitation of Node.js 4 itself. Spread operator is not available there (it's available only for arrays, i.e.
```JavaScript
const arr = [ 1, 2, 3 ]
console.log([ 0, ...arr ]);
	[ 0, 1, 2, 3 ]
```
rosen-vladimirov added a commit that referenced this pull request Jan 26, 2017
As the code is transpiled to ES6, spread operator from TypeScript is transpiled to spread operator in JavaScript.
However this usage is not available in Node.js 4:
```TypeScript
let { normalizedPropertyName, projectConfigurations } = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations);

// Replaced with:
let data = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations),
	normalizedPropertyName = data.normalizedPropertyName,
	projectConfigurations = data.projectConfigurations;
```

This is limitation of Node.js 4 itself. Spread operator is not available there (it's available only for arrays, i.e.
```JavaScript
const arr = [ 1, 2, 3 ]
console.log([ 0, ...arr ]);
	[ 0, 1, 2, 3 ]
```
rosen-vladimirov added a commit that referenced this pull request Jan 26, 2017
As the code is transpiled to ES6, spread operator from TypeScript is transpiled to spread operator in JavaScript.
However this usage is not available in Node.js 4:
```TypeScript
let { normalizedPropertyName, projectConfigurations } = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations);

// Replaced with:
let data = this.validateUpdatePropertyInfo(propertyName, propertyValues, configurations),
	normalizedPropertyName = data.normalizedPropertyName,
	projectConfigurations = data.projectConfigurations;
```

This is limitation of Node.js 4 itself. Spread operator is not available there (it's available only for arrays, i.e.
```JavaScript
const arr = [ 1, 2, 3 ]
console.log([ 0, ...arr ]);
	[ 0, 1, 2, 3 ]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants