Skip to content

Instantly share code, notes, and snippets.

@AndreSteenveld
Last active April 5, 2017 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreSteenveld/7d1648d0023245001fae0980df94de49 to your computer and use it in GitHub Desktop.
Save AndreSteenveld/7d1648d0023245001fae0980df94de49 to your computer and use it in GitHub Desktop.
Decorating properties with computed names
{
"presets": [ "es2015", "stage-1" ],
"plugins": [ "transform-decorators-legacy" ]
}
function d( ){ }
class C {
@d( )
[ "key" ] = "value";
}
{
"name": "broken-babel-properties-decorators",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"compilation-error": "babel ./compilation-error.js > ./compilation-error.output.js",
"runtime-error": "babel ./runtime-error.js > ./runtime-error.output.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-cli": "^6.24.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.24.0",
"babel-preset-stage-1": "^6.22.0"
}
}
function d( ){ }
class C {
@d( )
"key" = "value";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment