This is an automated email from the ASF dual-hosted git repository.

kszucs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 89b9d8c42bf6a04f75052a42640cdbec6c5eaa7e
Author: Adam Krebs <akr...@users.noreply.github.com>
AuthorDate: Thu Oct 3 13:57:45 2019 -0500

    ARROW-6785: [JS] Remove superfluous child assignment
    
    From `type.mjs`:
    ![Screenshot 2019-09-16 15 15 
45](https://user-images.githubusercontent.com/931368/64986774-c77b8b00-d895-11e9-9ed7-7d101b283361.png)
    
    TypeScript's data modifiers [automatically create a `this.children = 
children` 
assignment](http://www.typescriptlang.org/play/#code/KYDwDg9gTgLgBAYwDYEMDOa4GUZQK4IwA8AKnKDMAHYAmmA3nANoDWwAngFxxq4CWVAOYBdbgBEUMFCXZhgcAL5wAvHBRV2APnIhKtTBKky5pWcAB0OfIQA0cEtvoAoOK8QQqvazGgAKMHgARkh8CHBQwCg0HkjsiAAWfEg0EVTcAGJ8wMmkrBwQAGb2wppMwgCUcM5uNTx4clC+5QDcLrWuMIlo5giJyakqCUkp1K01Cm2uAcGhcILA8DBmAJI0TVXhC3hQVPZmlrgE8Oh7cgfezYqTcNMhYT5WAoLrjBEw27sABlZHRPQAJPROnxur1hqlzABbFBgXy+AqVZTaT6AgrmKgoSHABScVH
 [...]
    
    I suggest matching the other code and just removing the modifier instead of 
removing the assignment.
    
    Closes #5394 from akre54/patch-1 and squashes the following commits:
    
    ea97ebafe <Adam Krebs> Update js/src/type.ts
    32a126ee4 <Adam Krebs>  Remove superfluous child assignment
    
    Authored-by: Adam Krebs <akr...@users.noreply.github.com>
    Signed-off-by: Wes McKinney <wesm+...@apache.org>
---
 js/src/type.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/js/src/type.ts b/js/src/type.ts
index 602a838..2f5e33c 100644
--- a/js/src/type.ts
+++ b/js/src/type.ts
@@ -428,7 +428,8 @@ export class List<T extends DataType = any> extends 
DataType<Type.List, { [0]: T
 export interface Struct<T extends { [key: string]: DataType } = any> extends 
DataType<Type.Struct> { TArray: IterableArrayLike<RowLike<T>>; TValue: 
RowLike<T>; dataTypes: T; }
 /** @ignore */
 export class Struct<T extends { [key: string]: DataType } = any> extends 
DataType<Type.Struct, T> {
-    constructor(public readonly children: Field<T[keyof T]>[]) {
+    public readonly children: Field<T[keyof T]>[];
+    constructor(children: Field<T[keyof T]>[]) {
         super();
         this.children = children;
     }

Reply via email to