Skip to content

Commit

Permalink
Implement setComputedProperties
Browse files Browse the repository at this point in the history
- transform-computed-properties
  • Loading branch information
nicolo-ribaudo committed Dec 11, 2020
1 parent ee9deaa commit 62af78b
Show file tree
Hide file tree
Showing 29 changed files with 20 additions and 2 deletions.
Expand Up @@ -4,8 +4,10 @@ import { template, types as t } from "@babel/core";
export default declare((api, options) => {
api.assertVersion(7);

const { loose } = options;
const pushComputedProps = loose
const setComputedProperties =
options.loose || api.assumption?.("setComputedProperties");

const pushComputedProps = setComputedProperties
? pushComputedPropsLoose
: pushComputedPropsSpec;

Expand Down
@@ -0,0 +1,9 @@
{
"plugins": [
"external-helpers",
"transform-computed-properties"
],
"assumptions": {
"setComputedProperties": true
}
}
@@ -0,0 +1,4 @@
var obj = {
["x" + foo]: "heh",
["y" + bar]: "noo"
};
@@ -0,0 +1,3 @@
var _obj;

var obj = (_obj = {}, _obj["x" + foo] = "heh", _obj["y" + bar] = "noo", _obj);

0 comments on commit 62af78b

Please sign in to comment.