Version 6.x.x Source

Class JavascriptMinify

Inherits from __builtin__.object

_action (self, action)

do something! What you do is determined by the argument: 1 Output A. Copy B to A. Get the next B. 2 Copy B to A. Get the next B. (Delete A). 3 Get the next B. (Delete B). action treats a string as a single character. Wow! action recognizes a regular expression if it is preceded by ( or , or =.


_get (self)

return the next character from stdin. Watch out for lookahead. If the character is a control character, translate it to a space or linefeed.


_jsmin (self)

Copy the input to the output, deleting the characters which are insignificant to JavaScript. Comments will be removed. Tabs will be replaced with spaces. Carriage returns will be replaced with linefeeds. Most spaces and linefeeds will be removed.


_next (self)

get the next character, excluding comments. peek() is used to see if an unescaped '/' is followed by a '/' or '*'.


_outA (self)

No docs


_outB (self)

No docs


_peek (self)

No docs


minify (self, instream, outstream)

No docs



Class UnterminatedComment

Inherits from exceptions.Exception


Class UnterminatedRegularExpression

Inherits from exceptions.Exception


Class UnterminatedStringLiteral

Inherits from exceptions.Exception


frappe.utils.minify.isAlphanum (c)

return true if the character is a letter, digit, underscore, dollar sign, or non-ASCII character.


frappe.utils.minify.jsmin (js)

No docs