move es6.proxies to ludicrous
This commit is contained in:
@@ -87,8 +87,8 @@ export default class File {
|
||||
];
|
||||
|
||||
static soloHelpers = [
|
||||
"proxy-create",
|
||||
"proxy-directory"
|
||||
"ludicrous-proxy-create",
|
||||
"ludicrous-proxy-directory"
|
||||
];
|
||||
|
||||
static options = require("./options");
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
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,7 +3,6 @@ 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"),
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ export var metadata = {
|
||||
optional: true
|
||||
};
|
||||
|
||||
// foo in bar
|
||||
export function BinaryExpression(node) {
|
||||
if (node.operator === "in") {
|
||||
return util.template("ludicrous-in", {
|
||||
@@ -14,6 +15,7 @@ export function BinaryExpression(node) {
|
||||
}
|
||||
}
|
||||
|
||||
// { 1: "foo" }
|
||||
export function Property(node) {
|
||||
var key = node.key;
|
||||
if (t.isLiteral(key) && typeof key.value === "number") {
|
||||
@@ -21,9 +23,44 @@ export function Property(node) {
|
||||
}
|
||||
}
|
||||
|
||||
// /foobar/g
|
||||
export function Literal(node) {
|
||||
if (node.regex) {
|
||||
node.regex.pattern = "foobar";
|
||||
node.regex.flags = "";
|
||||
}
|
||||
}
|
||||
|
||||
// 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.bar = bar;
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user