Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RiESAEX committed Dec 15, 2021
1 parent 1fc3b28 commit 7d9c392
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swc-plugin-negative-indices",
"version": "1.0.5",
"version": "1.0.6",
"main": "index.js",
"author": "RiESAEX <[email protected]>",
"files":[],
Expand Down
2 changes: 1 addition & 1 deletion packages/linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swc-plugin-negative-indices-linux-x64-musl",
"version": "1.0.5",
"version": "1.0.6",
"main": "libswc_plugin_negative_indices.so",
"author": "RiESAEX <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/mac-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swc-plugin-negative-indices-darwin-x64",
"version": "1.0.5",
"version": "1.0.6",
"main": "libswc_plugin_negative_indices.dylib",
"author": "RiESAEX <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/win-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swc-plugin-negative-indices-win32-x64-msvc",
"version": "1.0.5",
"version": "1.0.6",
"main": "swc_plugin_negative_indices.dll",
"author": "RiESAEX <[email protected]>",
"license": "MIT",
Expand Down
9 changes: 4 additions & 5 deletions swc-plugin-negative-indices/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ use serde::Deserialize;
use swc_atoms::js_word;
use swc_common::util::take::Take;
use swc_common::DUMMY_SP;
use swc_ecmascript::ast::{
BinExpr, BinaryOp, Expr, ExprOrSuper, Ident, Lit, Number, UnaryExpr, UnaryOp,
};
use swc_ecmascript::visit::{Fold, VisitMut};
use swc_ecmascript::ast::{BinExpr, BinaryOp, Expr, Ident, Lit, UnaryExpr, UnaryOp};
use swc_ecmascript::visit::{Fold, VisitMut, VisitMutWith};
use swc_ecmascript::{ast::MemberExpr, visit::as_folder};
use swc_plugin::define_js_plugin;
define_js_plugin!(my_plugin);
Expand All @@ -20,9 +18,10 @@ struct MyPlugin;

impl VisitMut for MyPlugin {
fn visit_mut_member_expr(&mut self, expr: &mut MemberExpr) {
expr.visit_mut_children_with(self);
match &mut *expr.prop {
Expr::Unary(UnaryExpr {
span,
span: _,
op: UnaryOp::Minus,
arg,
}) => match &mut **arg {
Expand Down

0 comments on commit 7d9c392

Please sign in to comment.