Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Typescript 2.6 #118

Merged
merged 9 commits into from
Nov 28, 2017
Merged

Typescript 2.6 #118

merged 9 commits into from
Nov 28, 2017

Conversation

bryanforbes
Copy link
Member

Type: enhancement

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

Relates to dojo/meta#210

@bryanforbes bryanforbes requested a review from agubler November 9, 2017 20:19
@bryanforbes bryanforbes force-pushed the typescript-2.6 branch 3 times, most recently from 535f575 to 9cd2617 Compare November 13, 2017 18:15
Copy link
Member

@agubler agubler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few comments :)

src/Symbol.ts Outdated
@@ -24,7 +24,7 @@ if (!has('es6-symbol')) {
};

const defineProperties = Object.defineProperties;
const defineProperty: (o: any, p: string | symbol, attributes: PropertyDescriptor & ThisType<any>) => any = Object.defineProperty;
const defineProperty: (o: any, p: string | symbol, attributes: PropertyDescriptor & ThisType<any>) => any = <any> Object.defineProperty;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as any?

@@ -132,7 +132,9 @@ add('es6-string', () => {

add('es6-string-raw', () => {
function getCallSite(callSite: TemplateStringsArray, ...substitutions: any[]) {
return callSite;
const result = [...callSite];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: code style: [ ...callSite ]

@@ -132,7 +132,9 @@ add('es6-string', () => {

add('es6-string-raw', () => {
function getCallSite(callSite: TemplateStringsArray, ...substitutions: any[]) {
return callSite;
const result = [...callSite];
(<any> result).raw = callSite.raw;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: as any

@@ -22,8 +22,13 @@ export function getValueDescriptor<T>(value: T, enumerable: boolean = false, wri
*
* @param nativeFunction The source function to be wrapped
*/
export function wrapNative<T, U, R>(nativeFunction: (...args: U[]) => R): (target: T, ...args: U[]) => R {
return function (target: T, ...args: U[]): R {
export function wrapNative<T, U, R>(nativeFunction: (arg1: U) => R): (target: T, arg1: U) => R;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a change required for the TS2.6 upgrade?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If the old signature is left as-is, 10 errors occur. As an example, in src/array.ts the following error occurs:

src/array.ts(125,2): error TS2322: Type '(target: ArrayLike<T>, ...args: number[]) => ArrayLike<T>' is not assignable to type '<T>(target: ArrayLike<T>, offset: number, start: number, end?: number | undefined) => ArrayLike<T>'.
  Types of parameters 'args' and 'end' are incompatible.
    Type 'number | undefined' is not assignable to type 'number'.
      Type 'undefined' is not assignable to type 'number'.

@bryanforbes bryanforbes merged commit d88943f into dojo:master Nov 28, 2017
@bryanforbes bryanforbes deleted the typescript-2.6 branch November 28, 2017 21:04
@dylans dylans added this to the beta.5 milestone Dec 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants