From 4ed64065aa426d2ac2e7409598dafb08c5235edf Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Sat, 20 May 2017 22:42:27 -0700 Subject: [PATCH 1/2] pass interface and field name to Symbol ctor to be used as description --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 2f91fcc..7029075 100644 --- a/src/index.js +++ b/src/index.js @@ -16,7 +16,7 @@ export syntax interface = ctx => { let items = matchInterfaceItems(inner); let fields = items.reduce((acc, item) => { if (item.type === 'field' || item.type === 'static') { - return acc.concat(#`${item.name}: { value: Symbol(), + return acc.concat(#`${item.name}: { value: Symbol(${JSON.stringify(`${name}.${item.name}`)}), writable: false, configurable: false, enumerable: true },`); } else { return acc.concat(#`${item.name}: { value: function ${item.parens} ${item.body}, From 44ba78116d58384dc3dd1f33e7c528f9b3d9e849 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Sun, 21 May 2017 12:43:29 -0700 Subject: [PATCH 2/2] workaround for broken sweet.js brokenness --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 7029075..ac0525e 100644 --- a/src/index.js +++ b/src/index.js @@ -16,7 +16,7 @@ export syntax interface = ctx => { let items = matchInterfaceItems(inner); let fields = items.reduce((acc, item) => { if (item.type === 'field' || item.type === 'static') { - return acc.concat(#`${item.name}: { value: Symbol(${JSON.stringify(`${name}.${item.name}`)}), + return acc.concat(#`${item.name}: { value: Symbol(${fromStringLiteral(item.name, unwrap(name).value + '.' + unwrap(item.name).value)}), writable: false, configurable: false, enumerable: true },`); } else { return acc.concat(#`${item.name}: { value: function ${item.parens} ${item.body},