Merge branch 'proxies'
# Conflicts: # src/babel/transformation/file/index.js
This commit is contained in:
@@ -85,7 +85,10 @@ export default class File {
|
||||
"default-props"
|
||||
];
|
||||
|
||||
static soloHelpers = [];
|
||||
static soloHelpers = [
|
||||
"proxy-create",
|
||||
"proxy-directory"
|
||||
];
|
||||
|
||||
static options = require("./options");
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
"pluginOptions": {
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
"moduleId": {
|
||||
"description": "specify a custom name for module ids",
|
||||
"type": "string"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
(function (proxy, directory) {
|
||||
directory.push(proxy);
|
||||
return proxy;
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
[];
|
||||
43
src/babel/transformation/transformers/es6/proxies.js
Normal file
43
src/babel/transformation/transformers/es6/proxies.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import * as t from "../../../types";
|
||||
|
||||
export var metadata = {
|
||||
optional: true
|
||||
};
|
||||
|
||||
// foo.bar
|
||||
export function MemberExpression(node) {
|
||||
|
||||
}
|
||||
|
||||
// Object.setPrototypeOf
|
||||
// Object.preventExtensions
|
||||
// Object.keys
|
||||
// Object.isExtensible
|
||||
// Object.getOwnPropertyDescriptor
|
||||
// Object.defineProperty
|
||||
export function CallExpression(node) {
|
||||
|
||||
}
|
||||
|
||||
// delete foo.bar
|
||||
export function UnaryExpression(node) {
|
||||
|
||||
}
|
||||
|
||||
// foo in bar
|
||||
export function BinaryExpression(node) {
|
||||
|
||||
}
|
||||
|
||||
export function AssignmentExpression(node) {
|
||||
|
||||
}
|
||||
|
||||
// new Proxy
|
||||
export function NewExpression(node, parent, scope, file) {
|
||||
if (this.get("callee").isIdentifier({ name: "Proxy" })) {
|
||||
return t.callExpression(file.addHelper("proxy-create"), [node.arguments[0], file.addHelper("proxy-directory")]);
|
||||
} else {
|
||||
// possible proxy constructor
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ export default {
|
||||
"es7.trailingFunctionCommas": require("./es7/trailing-function-commas"),
|
||||
"es7.asyncFunctions": require("./es7/async-functions"),
|
||||
"es7.decorators": require("./es7/decorators"),
|
||||
"es6.proxies": require("./es6/proxies"),
|
||||
|
||||
strict: require("./other/strict"),
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export default class PathHoister {
|
||||
run() {
|
||||
var node = this.path.node;
|
||||
if (node._hoisted) return;
|
||||
this.path._hoisted = true;
|
||||
node._hoisted = true;
|
||||
|
||||
this.path.traverse(referenceVisitor, this);
|
||||
if (this.foundIncompatible) return;
|
||||
|
||||
Reference in New Issue
Block a user