;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require multiple-cursors-core dash] 2) #@22 (fn &optional POS) (defalias 'js2r--name-node-at-point #[256 "\211\206`\262\301!\302!>\204\301`S!\262\211\203$\302!>\204(\303\304!\207\207" [cl-struct-js2-name-node-tags js2-node-at-point type-of error "Point is not on an identifier."] 4 (#$ . 167)]) #@22 (fn &optional POS) (defalias 'js2r--local-name-node-at-point #[256 "\211\206`\262\300!\301!\204\302\303!\210\207" [js2r--name-node-at-point js2r--local-name-node-p error "Point is not on a local identifier"] 4 (#$ . 439)]) #@13 (fn NODE) (defalias 'js2r--local-name-node-p #[257 "\304!>\204\305\306\307D\"\210\211\310H\211\205[\304! >\205[\304!\n>\205:\304!\n>\2046\305\306\311D\"\210\312H=?\205[\304! >\205Z\304! >\204V\305\306\313D\"\210\314H=?\207" [cl-struct-js2-node-tags cl-struct-js2-name-node-tags cl-struct-js2-object-prop-node-tags cl-struct-js2-prop-get-node-tags type-of signal wrong-type-argument js2-node 5 js2-object-prop-node 7 js2-prop-get-node 8] 7 (#$ . 677)]) #@18 (fn NAME-NODE) (defalias 'js2r--name-node-defining-scope #[257 "\301!\204\n\302\303!\210\304\305!\306!>\204\307\310\311D\"\210\312H\"\207" [cl-struct-js2-name-node-tags js2r--local-name-node-p error "Node is not on a local identifier" js2-get-defining-scope js2-node-get-enclosing-scope type-of signal wrong-type-argument js2-name-node 6] 7 (#$ . 1160)]) #@18 (fn NAME-NODE) (defalias 'js2r--local-usages-of-name-node #[257 "\301!\204\n\302\303!\210\304!>\204\305\306\307D\"\210\211\310H\311!\312C\313\314\315$\"\210\211\242\207" [cl-struct-js2-name-node-tags js2r--local-name-node-p error "Node is not on a local identifier" type-of signal wrong-type-argument js2-name-node 6 js2r--name-node-defining-scope nil js2-visit-ast make-closure #[514 "\211\2047\304!\2037\300\305! >\204\306\307\310D\"\210\311H\230\2037\301\312!=\2037\302\242\235\2047\302\302\242B\240\210\313\207" [V0 V1 V2 cl-struct-js2-name-node-tags js2r--local-name-node-p type-of signal wrong-type-argument js2-name-node 6 js2r--name-node-defining-scope t] 7 "\n\n(fn NODE END-P)"]] 11 (#$ . 1532)]) #@18 (fn NAME-NODE) (defalias 'js2r--local-var-positions #[257 "\300\301\302!\"\207" [-map js2-node-abs-pos js2r--local-usages-of-name-node] 5 (#$ . 2276)]) #@17 (fn VAR-NODE) (defalias 'js2r--var-defining-node #[257 "\302!\204\n\303\304!\210\305!>\204\306\307\310D\"\210\211\311H\312!\313\"\305! >\2042\306\307\314D\"\210\211\315H\207" [cl-struct-js2-name-node-tags cl-struct-js2-symbol-tags js2r--local-name-node-p error "Node is not on a local identifier" type-of signal wrong-type-argument js2-name-node 6 js2r--name-node-defining-scope js2-scope-get-symbol js2-symbol 3] 8 (#$ . 2437)]) #@59 Find the contents of the current line, minus indentation. (defalias 'current-line-contents #[0 "\212\300 \210`)\212\301\210`){\207" [back-to-indentation nil] 2 (#$ . 2888)]) (require 'thingatpt) (defalias 'js2r-add-to-globals-annotation #[0 "\300\301!\212\302 \210\303\304\305 \"\204\306 \210\307y\210\310c\210\306 \210\307y\210\303\311\305 \"\204,\312y\210\202\312\210\313\314!\210\315\316!\204I\315\317!\203F\313\307!\210\2029\320c\210\211\321Pc)\207" [thing-at-point symbol beginning-of-buffer string-match "^/\\* *global " current-line-contents newline -1 "/* global */" "*/" nil delete-char -2 looking-back "global " " " ", " " */"] 4 nil nil]) #@73 Renames the variable on point and all occurrences in its lexical scope. (defalias 'js2r-rename-var #[0 "\301 \210\302 \303!>\204\304\305\306D\"\210\211\307H\310!\211\\\212\311\312\313#\314!\"\210)\315!\210b\210\316 \266\317 \207" [cl-struct-js2-node-tags js2r--guard js2r--local-name-node-at-point type-of signal wrong-type-argument js2-node 3 js2-node-abs-pos mapc make-closure #[257 "\211\301U?\205\211b\210\302\300\\!\210\303 \207" [V0 V1 set-mark mc/create-fake-cursor-at-point] 4 "\n\n(fn BEG)"] js2r--local-var-positions push-mark activate-mark mc/maybe-multiple-cursors-mode] 9 (#$ . 3554) nil]) (add-to-list 'mc--default-cmds-to-run-once 'js2r-rename-var) #@56 Changes the variable on point to use this.var instead. (defalias 'js2r-var-to-this #[0 "\301 \210\212\302 \303!>\2030\303!>\204\304\305\306D\"\210\211\307H\211A\203)\310\311!\210\312@!b\266\210\313\314 !\315\316\211\205x\211A\262\242\262\262T\262b\210\317\320!\203[\321\322!\210\202r\317\323!\203h\321\322!\210\202r\317\324!\203r\321\325!\210\326c\210\2028\266\204)\207" [cl-struct-js2-var-decl-node-tags js2r--guard js2-node-at-point type-of signal wrong-type-argument js2-var-decl-node 6 error "Currently does not support converting multivar statements." js2-node-abs-pos js2r--local-var-positions js2r--local-name-node-at-point 0 nil looking-back "var " delete-char -4 "let " "const " -6 "this."] 6 (#$ . 4241) nil]) (defalias 'js2r-inline-var #[0 "\302 \210\212\303 \304!\305!\306!>\204\307\310\311D\"\210\312H\306! >\204-\307\310\313D\"\210\211\314H\211\2048\315\316!\210\306!>\204H\307\310\311D\"\210\317H\305!\211\306!>\204_\307\310\311D\"\210\317H\\\320\305!!\320\306!>\204|\307\310\311\nD\"\210\317H\\!{\321\322\323  $\324 !\"\210\325\"\266\213)\207" [cl-struct-js2-node-tags cl-struct-js2-var-init-node-tags js2r--guard js2r--local-name-node-at-point js2r--var-defining-node js2-node-abs-pos type-of signal wrong-type-argument js2-node 5 js2-var-init-node 7 error "Var is not initialized when defined." 3 copy-marker mapc make-closure #[257 "\211\300U?\205\211b\210\303\301!\210\302c\207" [V0 V1 V2 delete-char] 3 "\n\n(fn BEG)"] js2r--local-var-positions js2r--delete-var-init] 17 nil nil]) (defalias 'js2r--was-single-var #[0 "\212\300 b\210\301\302!\206\301\303!)\207" [point-at-bol looking-at "^[[:space:]]*\\(var\\|const\\|let\\)[[:space:]]?;?$" "^[[:space:]]*,[[:space:]]*$"] 2]) (defalias 'js2r--was-starting-var #[0 "\300\301!\206\300\302!\206\300\303!\207" [looking-back "var " "const " "let "] 2]) (defalias 'js2r--was-ending-var #[0 "\300\301!\207" [looking-at ";"] 2]) #@16 (fn BEG END) (defalias 'js2r--delete-var-init #[514 "b\210\300Z!\210\301 \203\302 \303 |\210\304 \207\305 \203.\300\306!\210\307\310!\203*\300\306!\207\311\312!\207\313 \203K\314\315!\203@\300\312!\210\202G\311 \210\300\306!\210\300\312!\207\300\316!\207" [delete-char js2r--was-single-var point-at-bol point-at-eol delete-blank-lines js2r--was-starting-var 1 looking-at " " join-line -1 js2r--was-ending-var looking-back ", " 2] 5 (#$ . 6216)]) (defalias 'js2r--start-of-parent-stmt #[0 "\300\301 !\207" [js2-node-abs-pos js2r--closest-stmt-node] 2]) #@12 (fn POS) (defalias 'js2r--object-literal-key-behind #[257 "\212\211b\210\301\302!\205#\303u\210\304 \305!>\204\306\307\310D\"\210\211\311H\262)\207" [cl-struct-js2-name-node-tags looking-back "\\sw: ?" -2 js2r--name-node-at-point type-of signal wrong-type-argument js2-name-node 6] 6 (#$ . 6786)]) (defalias 'js2r--line-above-is-blank #[0 "\212\300y\210\301 \302\230)\207" [-1 current-line-contents ""] 2]) (defalias 'js2r-extract-var #[0 "\301 \210\302 \203\303\304 \305 \"\207\306 \303\307!\307!\310!>\204(\311\312\313D\"\210\314H\\\262\"\207" [cl-struct-js2-node-tags js2r--guard use-region-p js2r--extract-var-between region-beginning region-end js2r--closest-extractable-node js2-node-abs-pos type-of signal wrong-type-argument js2-node 3] 9 nil nil]) (add-to-list 'mc--default-cmds-to-run-once 'js2r-extract-var) #@16 (fn BEG END) (defalias 'js2r--extract-var-between #[514 "\302\"\204 \303\304!\210\305{\306 \306 \307!\206\310|\210\211c\210`\305\223\210\311 b\210\312!\210`\305\223\210\313\314\261\210\315 \204S\316\305\317\320#)\266\203\203V\321 \210\321 \210\322\"\210\212b\210\323`GZ!\210\324 \210)b\210\323`GZ!\210\305\211\223\210\305\211\223\210)\266\325 \207" [deactivate-mark inhibit-changing-match-data js2r--single-complete-expression-between-p error "Can only extract single, complete expressions to var" nil make-marker js2r--object-literal-key-behind "name" js2r--start-of-parent-stmt js2r--insert-var " = " ";" js2r--line-above-is-blank "^function " t string-match newline indent-region set-mark mc/create-fake-cursor-at-point mc/maybe-multiple-cursors-mode] 14 (#$ . 7631) "r"]) #@46 Insert a var definition for NAME. (fn NAME) (defalias 'js2r--insert-var #[257 "\203\301\202 \302\303\304#c\207" [js2r-prefer-let-over-var "let" "var" format "%s %s"] 6 (#$ . 8451)]) #@94 Split a variable declaration into separate variable declarations for each declared variable. (defalias 'js2r-split-var-declaration #[0 "\302 \210\212\303\304!\206 \305\306!\307!>\204\310\311\312D\"\210\211\313H\314!\211\315!\307! >\2045\310\311\316D\"\210\317H\\\262b\210\320\321\"\210\322\323!\210`\324!\210\325`\"\262\266\203)\207" [cl-struct-js2-var-decl-node-tags cl-struct-js2-node-tags js2r--guard js2r--closest js2-var-decl-node-p error "No var declaration at point." type-of signal wrong-type-argument js2-var-decl-node 6 js2-node-parent-stmt js2-node-abs-pos js2-node 3 mapc #[257 "\301\302!!\210\303c\210\304 \210\212\211\305!\306!>\204 \307\310\311D\"\210\312H\\\262b\210\313\314!)\2051\304 \207" [cl-struct-js2-node-tags js2r--insert-var js2-node-string ";" newline js2-node-abs-pos type-of signal wrong-type-argument js2-node 3 looking-at ", *\n *\n"] 7 "\n\n(fn KID)"] delete-char -1 js2r--goto-and-delete-node indent-region] 9 (#$ . 8646) nil]) (provide 'js2r-vars)