Remove assert

This commit is contained in:
Mohamed Hegazy
2018-05-14 22:49:50 -07:00
parent ba4bf21ead
commit 0bda862cca
2 changed files with 41 additions and 1 deletions

View File

@@ -3604,7 +3604,7 @@ namespace ts {
function symbolToParameterDeclaration(parameterSymbol: Symbol, context: NodeBuilderContext, preserveModifierFlags?: boolean): ParameterDeclaration {
const parameterDeclaration = getDeclarationOfKind<ParameterDeclaration>(parameterSymbol, SyntaxKind.Parameter);
Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter);
Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol));
let parameterType = getTypeOfSymbol(parameterSymbol);
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {

View File

@@ -0,0 +1,40 @@
/// <reference path='fourslash.ts' />
// @noImplicitAny: true
// @jsx: react
// @module: es2015
// @moduleResolution: node
// @Filename: /node_modules/@types/react/index.d.ts
////export = React;
////export as namespace React;
////declare namespace React {
//// export class Component { render(): JSX.Element | null; }
////}
////declare global {
//// namespace JSX {
//// interface Element {}
//// }
////}
// @filename: a.tsx
//// import React from 'react';
////
//// export default function Component([|props |]) {
//// if (props.isLoading) {
//// return <div>...Loading < /div>;
//// }
//// else {
//// return <AnotherComponent
//// update={
//// (rec) => {
//// return props.update(rec);
//// }
//// }
//// />;
//// }
//// }
verify.rangeAfterCodeFix("props: { isLoading: any; update: (...arg0: any) => void; }",/*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0);