;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'js2r-helpers) #@139 Log of the node at point, adding a 'console.log()' statement. With a prefix argument ARG, use JSON pretty-printing for logging. (fn ARG) (defalias 'js2r-log-this #[257 "\300 \210\301 \211@A\212\211b\210\302\303!\203\304u\210\305 \210\203.\306\307\261\210\305 \210\310\311\261\2025\306\312\313\261)\207" [js2r--guard js2r--figure-out-what-to-log-where looking-at "[;{]" 1 newline-and-indent "console.log(\"" " = \");" "console.dir(" ", { depth:null, colors: true });" " = \", " ");"] 9 (#$ . 112) "P"]) #@56 Debug the node at point, adding a 'debug()' statement. (defalias 'js2r-debug-this #[0 "\300 \210\301 \211@A\212\211b\210\302\303!\203\304u\210\305 \210\306\307\310\"\311\312\261)\207" [js2r--guard js2r--figure-out-what-to-log-where looking-at "[;{]" 1 newline-and-indent "debug(" js2r--wrap-text " = %s" ", " ");"] 8 (#$ . 634) nil]) #@105 Return a dotted pair containing the statement to log and the position where the log should be inserted. (defalias 'js2r--figure-out-what-to-log-where #[0 "\304\305 !\306 \203\307 \310 {\311!B\207\312 \313!>\204$\314\315\316D\"\210\211\317H\313! >\203W\313!\n>\204>\314\315\320D\"\210\321H\322\313! >\204Q\314\315\323D\"\210\324H!B\207\313! >\203\201\322!\322!\313!>\204u\314\315\316D\"\210\325H\\\262{\311!B\207\313!\n>\204\220\314\315\320D\"\210\321H\311!B\207" [cl-struct-js2-node-tags cl-struct-js2-function-node-tags cl-struct-js2-name-node-tags cl-struct-js2-prop-get-node-tags js2-node-parent-stmt js2-node-at-point use-region-p region-beginning region-end js2r--find-suitable-log-position-around js2r--name-node-at-point type-of signal wrong-type-argument js2-node 5 js2-name-node 6 js2-node-abs-pos js2-function-node 22 3] 10 (#$ . 981)]) #@104 Return the position close to PARENT-STMT where the log statement should be inserted. (fn PARENT-STMT) (defalias 'js2r--find-suitable-log-position-around #[257 "\302!>\203\212\303!b\210\304 \210\305u\210`)\207\211\303!\302! >\204*\306\307\310D\"\210\311H\\\207" [cl-struct-js2-return-node-tags cl-struct-js2-node-tags type-of js2-node-abs-pos beginning-of-line -1 signal wrong-type-argument js2-node 3] 7 (#$ . 1869)]) #@83 Split the string node at point. If the string is already split, join it instead. (defalias 'js2r-split-string #[0 "\300 \2054\301\302 !\303\304!\203\305u\210\306c\210\305u\2022\307\310\311\312\211#!!\203,\313\314!\2022\311\312\211#c\262\207" [js2r--point-inside-string-p js2r--string-delimiter js2-node-at-point looking-back " \"" -2 " +" looking-at regexp-quote format "%s + %s" delete-char 5] 7 (#$ . 2304) nil]) #@104 Return the delimiter character of the string node NODE. It can be a single or double quote. (fn NODE) (defalias 'js2r--string-delimiter #[257 "\212\300!b\210\301g!)\207" [js2-node-abs-pos char-to-string] 3 (#$ . 2737)]) #@38 Move the current line down one line. (defalias 'move-line-down #[0 "i\212\300y\210\301\302!\210)\300y\210\303!\207" [nil transpose-lines 1 move-to-column] 3 (#$ . 2965) nil]) #@36 Move the current line up one line. (defalias 'move-line-up #[0 "i\300\301!\210\302y\210\303!\207" [transpose-lines 1 -2 move-to-column] 3 (#$ . 3147) nil]) #@137 Move the current line down one line. Make sure commas are placed correctly when moving a line up or down in an object or array literal. (defalias 'js2r-move-line-down #[0 "\301 \203\302 \203\303 \210\202\304 \210 \207" [indent-line-function js2r--current-line-is-a-list-item js2r--next-line-is-a-list-item js2r--move-line-down-as-list-item move-line-down] 1 (#$ . 3311) nil]) #@135 Move the current line up one line. Make sure commas are placed correctly when moving a line up or down in an object or array literal. (defalias 'js2r-move-line-up #[0 "\301 \203\302 \203\303 \210\202\304 \210 \207" [indent-line-function js2r--current-line-is-a-list-item js2r--previous-line-is-a-list-item js2r--move-line-up-as-list-item move-line-up] 1 (#$ . 3701) nil]) #@62 Return whether the current line is prefixed with '{' or '['. (defalias 'js2r--current-line-is-prefixed-with-list-item-start #[0 "\212\300 \210\301\302!)\207" [back-to-indentation looking-back "\\({\\|\\[\\|,\\)\\( \\|\n\\| \\)*"] 2 (#$ . 4086)]) #@63 Return whether the current line is postfixed with '{' or '['. (defalias 'js2r--current-line-is-postfixed-with-list-item-end #[0 "\212\300\210\301\302!\206 \303\304!)\207" [nil looking-back ", *" looking-at "\\( \\|\n\\| \\)*\\(\\]\\|}\\)"] 2 (#$ . 4338)]) #@69 Return whether the current line contain an array or object literal. (defalias 'js2r--current-line-is-a-list-item #[0 "\300 \205\301 \207" [js2r--current-line-is-prefixed-with-list-item-start js2r--current-line-is-postfixed-with-list-item-end] 1 (#$ . 4602)]) #@69 Return whether the current line contain an array or object literal. (defalias 'js2r--next-line-is-a-list-item #[0 "\212\300y\210\301 )\207" [nil js2r--current-line-is-a-list-item] 1 (#$ . 4869)]) #@85 Return whether the previous line contain an array or object literal, and only that. (defalias 'js2r--previous-line-is-a-list-item #[0 "\212\300y\210\301 )\207" [-1 js2r--current-line-is-a-list-item] 1 (#$ . 5071)]) #@52 Return whether the current line ends with a comma. (defalias 'js2r--current-line-has-comma #[0 "\212\300\210\301\302!)\207" [nil looking-back ", *"] 2 (#$ . 5292)]) #@53 Return whether the previous line ends with a comma. (defalias 'js2r--previous-line-has-comma #[0 "\212\300y\210\301 )\207" [-1 js2r--current-line-has-comma] 1 (#$ . 5464)]) #@89 Move the current line containing a list literal down one line, and also move the comma. (defalias 'js2r--move-line-down-as-list-item #[0 "\300 \210\301 ?\205\212\302\210\303\304!\210\304y\210\302\210\305c)\207" [move-line-down js2r--previous-line-has-comma nil delete-char -1 ","] 2 (#$ . 5643)]) #@87 Move the current line containing a list literal up one line, and also move the comma. (defalias 'js2r--move-line-up-as-list-item #[0 "\300 \210\301 ?\205\212\302\210\303c\210\302y\210\302\210\304\305!)\207" [move-line-up js2r--current-line-has-comma nil "," delete-char -1] 2 (#$ . 5950)]) (provide 'js2r-conveniences)