Comments (8)
This feature is quite weird. If you create an intermediate variable (let foo = 'foo';
) you cannot index into A
with it (like A[foo]
) -- it only allows string literals. This makes me wonder whether we can just rewrite A['foo']
into A.foo
. I guess the former may occur for field names that aren't valid identifiers...
from tsickle.
Does it output a quoted access, or a non quoted? If it compiles into non
quoted, it'd actually be fine.
Evan Martin [email protected] schrieb am Fr., 18. Mรคrz 2016, 09:23:
This feature is quite weird. If you create an intermediate variable (let
foo = 'foo';) you cannot index into A with it (like A[foo]) -- it only
allows string literals.โ
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#23 (comment)
from tsickle.
It outputs quoted.
from tsickle.
Got a CL ready that checks this. I am pretty scared I'm accidentally warning on some other, legal thing, so I think I want to put this behind a temporary flag.
from tsickle.
Another antipattern I spotted in the same vein:
let data: {[key: string]: string} = {
foo: "bar",
};
I think you need to quote foo
to prevent it from being renamed.
from tsickle.
If you have an any
, perhaps we should require to use quoted accessors?
from tsickle.
from tsickle.
Randomly stumbled on this bug, through our documentation. Current status is that this is handled by 'https://tsetse.info/property-renaming-safe'. In any case, we definitely don't want to add such checks into tsickle - tslint and/or tsetse is the right layer for checks.
from tsickle.
Related Issues (20)
- No externs are generated for re-exported namespace HOT 7
- target ES2015 combined with external jquery reference throws JSC_REDECLARED_VARIABLE_ERROR HOT 1
- commonJsToGoogmoduleTransformer misses some `module.exports = ...` statements. HOT 5
- Use interfaces instead of namespaces in externs HOT 4
- Is tsickle intended to be used with json files? HOT 1
- can you do a release? HOT 18
- using clutz with a goog.module HOT 1
- package.json from npm appears to point to the wrong source directory HOT 7
- 0.41.0 installed via `npm i [email protected]` includes has possible debug line in it? HOT 1
- Stack overflow when translating a type with circular type parameter HOT 3
- exporting functions instead of classes HOT 2
- No version supporting Typescript 4.5 publicly available HOT 3
- Could not resolve dependency h-joo/TypeScript#ts45-no-double-comments HOT 8
- [email protected] references typescript version that doesnt exist HOT 1
- Enum values translated incorrect if using namespace HOT 8
- Could you release a NPM package? HOT 3
- String enums are converted to externs with empty strings enums HOT 5
- tsickle npm version compatible with Angular v15 HOT 3
- BUG: version 0.47.0 not auto released, typescript incompatibility for angular 15.2.1 HOT 1
- Does tsickle handle get/set accessors? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsickle.