Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
11d75ef
Allow Symbol indexer in ES6
JsonFreeman Jan 26, 2015
b30d8f3
Change computed property error messages to be about symbols
JsonFreeman Jan 28, 2015
39952b1
Syntactically allow computed properties everywhere if the name looks …
JsonFreeman Jan 28, 2015
d788624
Move hasDynamicName to utilities.ts
JsonFreeman Jan 28, 2015
07f3641
Update hasDynamicName to take well known symbols into account
JsonFreeman Jan 28, 2015
f344654
Add named property symbol for known Symbol properties
JsonFreeman Jan 28, 2015
30892af
Change computed property error message to mention Symbols
JsonFreeman Jan 29, 2015
9cb38fb
Create global Symbol type
JsonFreeman Jan 30, 2015
25fcbe2
Change certain hasDynamicName checks to check the SyntaxKind instead
JsonFreeman Jan 30, 2015
b60fa14
Add tests for operators with symbol operand
JsonFreeman Jan 30, 2015
779661c
Add tests for symbol properties
JsonFreeman Feb 2, 2015
95af997
Accept correct baselines for symbol property tests
JsonFreeman Feb 3, 2015
e508bf7
Add symbol keyword
JsonFreeman Feb 3, 2015
ebdd96b
Update tests to use new symbol keyword
JsonFreeman Feb 3, 2015
e346b70
Change isTypeOfKind calls to pass symbol TypeFlag when needed
JsonFreeman Feb 4, 2015
59a704e
Rename references in es6.d.ts from Symbol to symbol
JsonFreeman Feb 4, 2015
d793658
Change Symbol to symbol in error messages
JsonFreeman Feb 4, 2015
2d16474
Fix expression checking for symbols
JsonFreeman Feb 5, 2015
6a6c03b
Fix error message wording
JsonFreeman Feb 5, 2015
92617f5
Don't pass prop.name directly for error reporting
JsonFreeman Feb 5, 2015
fbeadbc
Add test for new Symbol()
JsonFreeman Feb 5, 2015
9f39a53
Make Symbol the apparent type of symbol
JsonFreeman Feb 5, 2015
df826de
symbols in type guards
JsonFreeman Feb 5, 2015
d07ed67
Support indexing with known symbols
JsonFreeman Feb 6, 2015
8325862
Fix error message
JsonFreeman Feb 6, 2015
3834edd
Refactor part of getPropertyNameForIndexedAccess into checkSymbolName…
JsonFreeman Feb 6, 2015
4c09ccd
Check that Symbol properties are proper, and support downlevel type c…
JsonFreeman Feb 7, 2015
3560442
Declaration emit for symbol properties
JsonFreeman Feb 7, 2015
2f3c32a
Navigation bar support for symbols
JsonFreeman Feb 7, 2015
eb50619
Disable symbol indexer
JsonFreeman Feb 7, 2015
52cb13e
Uncomment symbol properties in es6.d.ts
JsonFreeman Feb 7, 2015
75382c1
Accept baselines after rebase
JsonFreeman Feb 7, 2015
18276e5
Address feedback from @yuit
JsonFreeman Feb 11, 2015
a94e61b
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
JsonFreeman Feb 11, 2015
486cebd
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
JsonFreeman Feb 12, 2015
4942c5f
Address feedback
JsonFreeman Feb 13, 2015
9c273d8
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
JsonFreeman Feb 13, 2015
65d831e
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
JsonFreeman Feb 16, 2015
ac829a8
Error for naming an interface 'symbol'
JsonFreeman Feb 16, 2015
7d7d54f
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
JsonFreeman Feb 16, 2015
935c602
Rebaseline after merge
JsonFreeman Feb 16, 2015
59dc7d3
Address feedback
JsonFreeman Feb 17, 2015
dd6a129
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
JsonFreeman Feb 17, 2015
47404bc
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
JsonFreeman Feb 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename references in es6.d.ts from Symbol to symbol
  • Loading branch information
JsonFreeman committed Feb 7, 2015
commit 59a704e7c1f8a40c705bf96220eefbafd4718668
26 changes: 13 additions & 13 deletions src/lib/es6.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare type PropertyKey = string | number | Symbol;
declare type PropertyKey = string | number | symbol;

interface Symbol {
/** Returns a string representation of an object. */
Expand All @@ -20,64 +20,64 @@ interface SymbolConstructor {
* Returns a new unique Symbol value.
* @param description Description of the new Symbol object.
*/
(description?: string|number): Symbol;
(description?: string|number): symbol;

/**
* Returns a Symbol object from the global symbol registry matching the given key if found.
* Otherwise, returns a new symbol with this key.
* @param key key to search for.
*/
for(key: string): Symbol;
for(key: string): symbol;

/**
* Returns a key from the global symbol registry matching the given Symbol if found.
* Otherwise, returns a undefined.
* @param sym Symbol to find the key for.
*/
keyFor(sym: Symbol): string;
keyFor(sym: symbol): string;

// Well-known Symbols

/**
* A method that determines if a constructor object recognizes an object as one of the
* constructor’s instances. Called by the semantics of the instanceof operator.
*/
hasInstance: Symbol;
hasInstance: symbol;

/**
* A Boolean value that if true indicates that an object should flatten to its array elements
* by Array.prototype.concat.
*/
isConcatSpreadable: Symbol;
isConcatSpreadable: symbol;

/**
* A Boolean value that if true indicates that an object may be used as a regular expression.
*/
isRegExp: Symbol;
isRegExp: symbol;

/**
* A method that returns the default iterator for an object.Called by the semantics of the
* for-of statement.
*/
iterator: Symbol;
iterator: symbol;

/**
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
* abstract operation.
*/
toPrimitive: Symbol;
toPrimitive: symbol;

/**
* A String value that is used in the creation of the default string description of an object.
* Called by the built- in method Object.prototype.toString.
*/
toStringTag: Symbol;
toStringTag: symbol;

/**
* An Object whose own property names are property names that are excluded from the with
* environment bindings of the associated objects.
*/
unscopables: Symbol;
unscopables: symbol;
}
declare var Symbol: SymbolConstructor;

Expand Down Expand Up @@ -108,7 +108,7 @@ interface ObjectConstructor {
* Returns an array of all symbol properties found directly on object o.
* @param o Object to retrieve the symbols from.
*/
getOwnPropertySymbols(o: any): Symbol[];
getOwnPropertySymbols(o: any): symbol[];

/**
* Returns true if the values are the same value, false otherwise.
Expand Down Expand Up @@ -3521,7 +3521,7 @@ declare var Reflect: {
getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
getPrototypeOf(target: any): any;
has(target: any, propertyKey: string): boolean;
has(target: any, propertyKey: Symbol): boolean;
has(target: any, propertyKey: symbol): boolean;
isExtensible(target: any): boolean;
ownKeys(target: any): Array<PropertyKey>;
preventExtensions(target: any): boolean;
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
Expand Down
7 changes: 5 additions & 2 deletions tests/baselines/reference/APISample_compile.types
Original file line number Diff line number Diff line change
Expand Up @@ -3314,10 +3314,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags

Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags

Intrinsic = 1048703,
>Intrinsic : TypeFlags

Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags

StringLike = 258,
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
Expand Down
7 changes: 5 additions & 2 deletions tests/baselines/reference/APISample_linter.types
Original file line number Diff line number Diff line change
Expand Up @@ -3458,10 +3458,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags

Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags

Intrinsic = 1048703,
>Intrinsic : TypeFlags

Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags

StringLike = 258,
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
Expand Down
7 changes: 5 additions & 2 deletions tests/baselines/reference/APISample_transform.types
Original file line number Diff line number Diff line change
Expand Up @@ -3410,10 +3410,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags

Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags

Intrinsic = 1048703,
>Intrinsic : TypeFlags

Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags

StringLike = 258,
Expand Down
5 changes: 3 additions & 2 deletions tests/baselines/reference/APISample_watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,9 @@ declare module "typescript" {
ObjectLiteral = 131072,
ContainsUndefinedOrNull = 262144,
ContainsObjectLiteral = 524288,
Intrinsic = 127,
Primitive = 510,
ESSymbol = 1048576,
Intrinsic = 1048703,
Primitive = 1049086,
StringLike = 258,
NumberLike = 132,
ObjectType = 48128,
Expand Down
7 changes: 5 additions & 2 deletions tests/baselines/reference/APISample_watcher.types
Original file line number Diff line number Diff line change
Expand Up @@ -3583,10 +3583,13 @@ declare module "typescript" {
ContainsObjectLiteral = 524288,
>ContainsObjectLiteral : TypeFlags

Intrinsic = 127,
ESSymbol = 1048576,
>ESSymbol : TypeFlags

Intrinsic = 1048703,
>Intrinsic : TypeFlags

Primitive = 510,
Primitive = 1049086,
>Primitive : TypeFlags

StringLike = 258,
Expand Down
5 changes: 2 additions & 3 deletions tests/baselines/reference/parserSymbolIndexer1.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
interface I {
>I : I

[s: Symbol]: string;
>s : Symbol
>Symbol : Symbol
[s: symbol]: string;
>s : symbol
}
5 changes: 2 additions & 3 deletions tests/baselines/reference/parserSymbolIndexer2.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
class C {
>C : C

[s: Symbol]: string;
>s : Symbol
>Symbol : Symbol
[s: symbol]: string;
>s : symbol
}
5 changes: 2 additions & 3 deletions tests/baselines/reference/parserSymbolIndexer4.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
var x: {
>x : {}

[s: Symbol]: string;
>s : Symbol
>Symbol : Symbol
[s: symbol]: string;
>s : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty1.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ interface I {
>I : I

[Symbol.iterator]: string;
>Symbol.iterator : Symbol
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>iterator : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty2.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ interface I {
>I : I

[Symbol.unscopables](): string;
>Symbol.unscopables : Symbol
>Symbol.unscopables : symbol
>Symbol : SymbolConstructor
>unscopables : Symbol
>unscopables : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty3.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare class C {
>C : C

[Symbol.unscopables](): string;
>Symbol.unscopables : Symbol
>Symbol.unscopables : symbol
>Symbol : SymbolConstructor
>unscopables : Symbol
>unscopables : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty4.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare class C {
>C : C

[Symbol.isRegExp]: string;
>Symbol.isRegExp : Symbol
>Symbol.isRegExp : symbol
>Symbol : SymbolConstructor
>isRegExp : Symbol
>isRegExp : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty5.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class C {
>C : C

[Symbol.isRegExp]: string;
>Symbol.isRegExp : Symbol
>Symbol.isRegExp : symbol
>Symbol : SymbolConstructor
>isRegExp : Symbol
>isRegExp : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty6.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class C {
>C : C

[Symbol.toStringTag]: string = "";
>Symbol.toStringTag : Symbol
>Symbol.toStringTag : symbol
>Symbol : SymbolConstructor
>toStringTag : Symbol
>toStringTag : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty7.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class C {
>C : C

[Symbol.toStringTag](): void { }
>Symbol.toStringTag : Symbol
>Symbol.toStringTag : symbol
>Symbol : SymbolConstructor
>toStringTag : Symbol
>toStringTag : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty8.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var x: {
>x : { [Symbol.toPrimitive](): string; }

[Symbol.toPrimitive](): string
>Symbol.toPrimitive : Symbol
>Symbol.toPrimitive : symbol
>Symbol : SymbolConstructor
>toPrimitive : Symbol
>toPrimitive : symbol
}
4 changes: 2 additions & 2 deletions tests/baselines/reference/parserSymbolProperty9.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var x: {
>x : { [Symbol.toPrimitive]: string; }

[Symbol.toPrimitive]: string
>Symbol.toPrimitive : Symbol
>Symbol.toPrimitive : symbol
>Symbol : SymbolConstructor
>toPrimitive : Symbol
>toPrimitive : symbol
}
11 changes: 5 additions & 6 deletions tests/baselines/reference/symbolProperty1.types
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
=== tests/cases/conformance/es6/Symbols/symbolProperty1.ts ===
var s: Symbol;
>s : Symbol
>Symbol : Symbol
var s: symbol;
>s : symbol

var x = {
>x : {}
>{ [s]: 0, [s]() { }, get [s]() { return 0; }} : {}

[s]: 0,
>s : Symbol
>s : symbol

[s]() { },
>s : Symbol
>s : symbol

get [s]() {
>s : Symbol
>s : symbol

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/symbolProperty11.types
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ interface I {
>I : I

[Symbol.iterator]?: { x };
>Symbol.iterator : Symbol
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>iterator : symbol
>x : any
}

Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/symbolProperty13.types
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ class C {
>C : C

[Symbol.iterator]: { x; y };
>Symbol.iterator : Symbol
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>iterator : symbol
>x : any
>y : any
}
interface I {
>I : I

[Symbol.iterator]: { x };
>Symbol.iterator : Symbol
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>iterator : symbol
>x : any
}

Expand Down
Loading