Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.

tsickle should emit goog.reflect.objectProperty for property names passed to __rest tslib helper #1047

Open

Description

@mitchellwills

rest destructuring assignments are not safe for closure compiler because tsc/tsickle emits property names as quoted strings. It looks like it should be pretty simple to apply goog.reflect.objectProperty here

Example Input:

const input = {x: 1, y: 2, z: 3};
const {x, ...rest} = input;

Current Emit:

const input = { x: 1, y: 2, z: 3 };
const { x } = input, rest = __rest(input, ["x"]);

Proposed Emit:

const input = { x: 1, y: 2, z: 3 };
const { x } = input, rest = __rest(input, [goog.reflect.objectProperty("x", input)]);

Related: #241
This probably applies to other emit too

Activity

  1. evmar commented on Jul 23, 2019

    @evmar
    Contributor

    To hook this, I think we'd need to postprocess the JS output to look for calls to __rest (really tslib's rest).

  2. jplaisted commented on Jul 23, 2019

    @jplaisted

    Alternatively can tsickle just emit the same code? Why is it lowering the language level?

  3. brad4d commented on Nov 3, 2020

    @brad4d
    Contributor

    Internal issue created http://b/171341422

  4. self-assigned this
    on Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions