-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from Titozzz/master
fix: object key being wrongly transformed
- Loading branch information
Showing
6 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"babel-plugin-transform-define": patch | ||
--- | ||
|
||
Addresses #85, avoids replacing object keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
test/binding | ||
test/import-identifiers | ||
test/object-keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const obj = { | ||
__DEV__ | ||
}; | ||
const obj1 = { | ||
__DEV__: "test" | ||
}; | ||
const obj2 = { | ||
__DEV__: __DEV__ | ||
}; | ||
const obj3 = { | ||
"__DEV__": __DEV__ | ||
}; | ||
const obj4 = { | ||
["__DEV__"]: __DEV__ | ||
}; | ||
|
||
const obj5 = { | ||
[__DEV__]: __DEV__ | ||
}; | ||
|
||
const obj6 = { | ||
[__DEV2__]: __DEV2__ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"use strict"; | ||
|
||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
|
||
var obj = { | ||
__DEV__: true | ||
}; | ||
var obj1 = { | ||
__DEV__: "test" | ||
}; | ||
var obj2 = { | ||
__DEV__: true | ||
}; | ||
var obj3 = { | ||
"__DEV__": true | ||
}; | ||
|
||
var obj4 = _defineProperty({}, "__DEV__", true); | ||
|
||
var obj5 = _defineProperty({}, true, true); | ||
|
||
var obj6 = _defineProperty({}, "true", "true"); |