⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 js.texi

📁 一个类似windows
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@item 00400
read by owner
@item 00200
write by owner
@item 00100
execute / search by owner

@item 00040
read by group
@item 00020
write by group
@item 00010
execute / search by group

@item 00004
read by others
@item 00002
write by others
@item 00001
execute / search by others
@end table
@end defop

@defop {Static Method} File lstat (path)

@table @strong
@item Standard
@value{NGS}
@end table

@end defop

@defop {Static Method} File remove (path)

@table @strong
@item Standard
@value{NGS}
@end table

@end defop

@defop {Static Method} File rename (path)

@table @strong
@item Standard
@value{NGS}
@end table

@end defop

@defop {Static Method} File stat (path)

@table @strong
@item Standard
@value{NGS}
@end table

Return statistics about the file @var{file}.  The method returns a 13
element array containing the statistics, or @samp{false} if the file
couldn't be inspected.

The returned array contains the following items:

@table @code
@item dev
Device that contains a directory entry for this file.

@item ino
Index of this file on its device.  A file is uniquely identified by
specifying its @code{dev} and @code{ino}.

@item mode
The mode of the file.

@item nlink
The number of hard links to the file.

@item uid
The ID of the file owner.

@item gid
The ID of the file group.

@item rdev
The ID of the device.

@item size
The size of the file.

@item atime
The time when the data was last accessed.

@item mtime
The time when the data was last modified.

@item ctime
The time when the file status was last changed.

@item blksize
Preferred blocksize for file system I/O.

@item blocks
The number of blocks the file actually uses.
@end table

@c @cartouche
@example
fields = new Array ("dev", "ino", "mode", "nlink", "uid",
                    "gid", "rdev", "size", "atime",
                    "mtime", "ctime", "blksize", "blocks");

var a = File.stat ("js");
if (a)
  @{
    var i;
    for (i = 0; i < a.length; i++)
      System.print (fields[i], "=", a[i], " ");
    System.print ("\n");
  @}

@print{} dev=655368 ino=370741 mode=33261 nlink=1 uid=201 gid=200
@print{} rdev=2979328 size=731370 atime=893159080 mtime=893158537
@print{} ctime=893158537 blksize=4096 blocks=1432
@end example
@c @end cartouche
@end defop


@defop {Static Method} File stringToByte (string)
@end defop



@defmethod File open (mode)

The argument @var{mode} must have one of the following values:

@table @r
@item @code{r}[@code{b}]
@item @code{w}[@code{b}]
@item @code{a}[@code{b}]
@item @code{r+}[@code{b}]
@item @code{w+}[@code{b}]
@item @code{a+}[@code{b}]
@end table

@end defmethod

@defmethod File close ()
@end defmethod

@defmethod File setPosition (position[, whence])
@end defmethod

@defmethod File getPosition ()
@end defmethod

@defmethod File eof ()
@end defmethod

@defmethod File read (size)
@end defmethod

@defmethod File readln ()
@end defmethod

@defmethod File readByte ()
@end defmethod

@defmethod File toString ()
@end defmethod

@defmethod File write (string)
@end defmethod

@defmethod File writeln (string)
@end defmethod

@defmethod File writeByte (byte)
@end defmethod

@defmethod File ungetByte (byte)

@table @strong
@item Standard
@value{NGS}
@end table

@end defmethod

@defmethod File flush ()
@end defmethod

@defmethod File getLength ()
@end defmethod

@defmethod File exists ()
@end defmethod

@defmethod File error ()
@end defmethod

@defmethod File clearError ()
@end defmethod

@defcv Property File autoFlush

@table @strong
@item Standard
@value{NGS}
@end table

Flag that specifies whether the stream should automatically flush its
buffers after a write.
@end defcv

@defcv Property File bufferSize

@table @strong
@item Standard
@value{NGS}
@end table

The I/O buffer size of the stream.  The buffer size can be changed at
the runtime.
@end defcv

@c ----------------------------------------------------------------------
@node Directory, Function, File, Native Objects
@subsection Directory

@table @strong
@item Standard
@value{NGS}
@end table

@deffn Constructor Directory (path)
@end deffn

@defmethod Directory close ()
@end defmethod

@defmethod Directory open ()
@end defmethod

@defmethod Directory read ()
@end defmethod

@defmethod Directory rewind ()
@end defmethod

@defmethod Directory seek (pos)
@end defmethod

@defmethod Directory tell ()
@end defmethod


@c ----------------------------------------------------------------------
@node Function, Math, Directory, Native Objects
@subsection Function

@c ----------------------------------------------------------------------
@node Math, Number, Function, Native Objects
@subsection Math

@table @strong
@item Standard
@value{ECMA}
@end table

@defop {Static Method} Math abs (@var{x})
@end defop

@defop {Static Method} Math acos (@var{x})
@end defop

@defop {Static Method} Math asin (@var{x})
@end defop

@defop {Static Method} Math atan (@var{x})
@end defop

@defop {Static Method} Math atan2 (@var{y}, @var{x})
@end defop

@defop {Static Method} Math ceil (@var{x})
@end defop

@defop {Static Method} Math cos (@var{x})
@end defop

@defop {Static Method} Math exp (@var{x})
@end defop

@defop {Static Method} Math floor (@var{x})
@end defop

@defop {Static Method} Math log (@var{x})
@end defop

@defop {Static Method} Math max (@var{x}, @var{y})
@end defop

@defop {Static Method} Math min (@var{x}, @var{y})
@end defop

@defop {Static Method} Math pow (@var{x}, @var{y})
@end defop

@defop {Static Method} Math random ()
@end defop

@defop {Static Method} Math round (@var{x})
@end defop

@defop {Static Method} Math seed (@var{x})

@table @strong
@item Standard
@value{NGS}
@end table

@end defop

@defop {Static Method} Math sin (@var{x})
@end defop

@defop {Static Method} Math sqrt (@var{x})
@end defop

@defop {Static Method} Math tan (@var{x})
@end defop



@defcv {Static Property} Math E
@end defcv

@defcv {Static Property} Math LN10
@end defcv

@defcv {Static Property} Math LN2
@end defcv

@defcv {Static Property} Math LOG10E
@end defcv

@defcv {Static Property} Math LOG2E
@end defcv

@defcv {Static Property} Math PI
@end defcv

@defcv {Static Property} Math SQRT1_2
@end defcv

@defcv {Static Property} Math SQRT2
@end defcv

@c ----------------------------------------------------------------------
@node Number, Object, Math, Native Objects
@subsection Number

@table @strong
@item Standard
@value{ECMA}
@end table

@defun Number()
Return value @code{0}.
@end defun

@defun Number (value)
@end defun

@c --- Constructors -----------------------------------------------------

@deffn Constructor Number ()
@deffnx Constructor Number (@var{value})
Create a new number object.  If no argument is given, the constructor
returns value @code{+0}.  If the argument @var{value} is given, the
constructor returns @code{ToNumber(@var{value})}.

@example
new Number ();
@result{} 0
new Number (3.1415);
@result{} 3.1415
new Number (true);
@result{} 1
@end example

@end deffn

@defmethod Number toString ([@var{radix}])
Convert the number to its textual presentation.  If the argument
@var{radix} is given, it specifies the radix to which the number is
formatted.  If the argument @var{radix} is not given, it defaults to
@code{10}.

@example
System.stdout.writeln ((193).toString ());
@print{} 193
System.stdout.writeln ((193).toString (8));
@print{} 301
System.stdout.writeln ((193).toString (16));
@print{} c1
System.stdout.writeln ((193).toString (2));
@print{} 11000001
@end example
@end defmethod

@defmethod Number valueOf ()
Return the value of the number object.
@end defmethod


@defcv {Static Property} Number MAX_VALUE
@end defcv

@defcv {Static Property} Number MIN_VALUE
@end defcv

@defcv {Static Property} Number NaN
@end defcv

@defcv {Static Property} Number NEGATIVE_INFINITY
@end defcv

@defcv {Static Property} Number POSITIVE_INFINITY
@end defcv


@c ----------------------------------------------------------------------
@node Object, RegExp, Number, Native Objects
@subsection Object

@table @strong
@item Standard
@value{ECMA}
@item Incompatibilities
@itemize @bullet
@item The @code{toString()} and @code{toSource()} methods are missing.
@item The constructor doesn't set the [[Prototype]] and [[Class]]
properties.
@end itemize
@end table


@defun Object ([@var{value}])
@end defun

@c --- Constructors -----------------------------------------------------

@deffn Constructor Object ([@var{value}])
Create a new object.

@example
var o = new Object ();
@end example
@end deffn

@c --- Methods ----------------------------------------------------------

@defmethod Object toString ()
@end defmethod

@defmethod Object toSource ()
@end defmethod

@defmethod Object valueOf ()
@end defmethod


@c ----------------------------------------------------------------------
@node RegExp, String, Object, Native Objects
@subsection RegExp

@table @strong
@item Standard
@value{ECMA}

@item Incompatibilities
@itemize @bullet
@item The regular expression engine -- taken from the GNU Emacs -- might
not support all features that are required.
@item XXX Check all methods and properties.
@end itemize
@end table

@deffn Constructor RegExp (pattern[, flags])

Create a new regular expression from string @var{pattern}.  The optional
argument string @var{flags} can contain the following options:

@table @code
@item i
Ignore case; the matching is case-insensitive.

@item g
Global search.  This allows you to iterate over all matches of the
expression by executing the @code{exec} method multiple times against
the string.
@end table
@end deffn

@defmethod RegExp compile (@var{pattern}[, @var{flags}])
Create a new regular expression from string @var{pattern} using optional
options @var{flags}.  The method can be used to change the regular
expression pattern or its flags in the regular expression object.
The method returns an error if the string @var{pattern} do not specify a
well-formed regular expression.

@strong{Note!}  All regular expressions are always compiled in this
implementation.  This holds also for the expressions, created with the
@code{RegExp()} constructor.

@c @cartouche
@example
var re = new RegExp ("ab*");
re.compile ("ab*", "i");
@end example
@c @end cartouche
@end defmethod

@defmethod RegExp exec ([string])
Match the expression against the string @var{string}.  If the argument
@var{string} is omitted, the regular expression is matched against the
@code{RegExp.input} string.  The method returns an array that holds the
matched portions of the expression.

@c @cartouche

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -