]> git.kaiwu.me - njs.git/log
njs.git
7 years agoFixed various clang static analyzer warnings.
Dmitry Volyntsev [Mon, 19 Nov 2018 13:30:35 +0000 (16:30 +0300)]
Fixed various clang static analyzer warnings.

In njs_object_keys_array() function.

7 years agoHandling non-object values in Object.keys().
Dmitry Volyntsev [Thu, 15 Nov 2018 17:31:35 +0000 (20:31 +0300)]
Handling non-object values in Object.keys().

This fixes #54 issue on Github.

7 years agoExtended Object.defineProperty() spec conformance.
Dmitry Volyntsev [Thu, 15 Nov 2018 17:31:35 +0000 (20:31 +0300)]
Extended Object.defineProperty() spec conformance.

  1) non-primitive property names.
  2) support of array index properties.
  3) support of special properties with
     NJS_PROPERTY_HANDLER, like length.

7 years agoFixed local scope this.
Dmitry Volyntsev [Thu, 15 Nov 2018 17:31:35 +0000 (20:31 +0300)]
Fixed local scope this.

7 years agoFixed global objects.
Dmitry Volyntsev [Thu, 15 Nov 2018 17:31:35 +0000 (20:31 +0300)]
Fixed global objects.

    1) Making it extensible.
    2) Adding default properties according to ES5.1:15.1.1.

8 years agoImproved handling of builtin objects.
Dmitry Volyntsev [Wed, 4 Apr 2018 14:38:10 +0000 (17:38 +0300)]
Improved handling of builtin objects.

The handling of njs_object_init_t arrays is unified across
njs_builtin.c functions.

7 years agoconsole.time() and console.timeEnd() methods.
Artem S. Povalyukhin [Wed, 14 Nov 2018 15:14:49 +0000 (18:14 +0300)]
console.time() and console.timeEnd() methods.

This fixes #62 issue on Github.

7 years agoFixed lvlhsh test on 64-bit big-endian systems.
Valentin Bartenev [Thu, 15 Nov 2018 09:45:02 +0000 (12:45 +0300)]
Fixed lvlhsh test on 64-bit big-endian systems.

The nxt_murmur_hash2() generated 4-byte hash that was stored in uintptr_t,
which was 8 bytes long on 64-bit systems.  At each iteration, it took the
previous key and hashed it again.

The problem was that it took only the first 4 bytes of the key, and these
4 bytes were always zero on 64-bit big-endian system.  That resulted in
equal keys at each iteration.

The bug was discovered on IBM/S390x.

7 years agoTolerate epsilon difference in the previous unit test change.
Sergey Kandaurov [Tue, 13 Nov 2018 12:25:00 +0000 (15:25 +0300)]
Tolerate epsilon difference in the previous unit test change.

7 years agoFixed unit tests for SunC.
Sergey Kandaurov [Tue, 13 Nov 2018 11:16:54 +0000 (14:16 +0300)]
Fixed unit tests for SunC.

7 years agoFixed building by SunC 5.15.
Sergey Kandaurov [Mon, 12 Nov 2018 17:08:36 +0000 (20:08 +0300)]
Fixed building by SunC 5.15.

7 years agoAllowing variables and functions to be redeclared.
Dmitry Volyntsev [Mon, 12 Nov 2018 15:27:05 +0000 (18:27 +0300)]
Allowing variables and functions to be redeclared.

7 years agoRegExp: fixed a case when lastIndex is greater than string size.
Valentin Bartenev [Mon, 12 Nov 2018 14:22:14 +0000 (17:22 +0300)]
RegExp: fixed a case when lastIndex is greater than string size.

Previously, it resulted in: "InternalError: pcre_exec() failed: -32" due to
negative string size caused by subtraction of last_index.

7 years agoFixed equality operator with object and string.
Valentin Bartenev [Fri, 9 Nov 2018 15:22:01 +0000 (18:22 +0300)]
Fixed equality operator with object and string.

7 years agoFixed equality operator when both operands are objects.
Valentin Bartenev [Thu, 8 Nov 2018 17:32:45 +0000 (20:32 +0300)]
Fixed equality operator when both operands are objects.

7 years agoFixed equality operator with "null" value as right operand.
Valentin Bartenev [Fri, 9 Nov 2018 15:05:39 +0000 (18:05 +0300)]
Fixed equality operator with "null" value as right operand.

7 years agoFixed misplaced njs_internal_error().
Valentin Bartenev [Thu, 8 Nov 2018 13:45:54 +0000 (16:45 +0300)]
Fixed misplaced njs_internal_error().

7 years agonjs_vm_run() is simplified.
Dmitry Volyntsev [Wed, 7 Nov 2018 15:41:29 +0000 (18:41 +0300)]
njs_vm_run() is simplified.

7 years agoAdded njs_vm_retval_dump().
Dmitry Volyntsev [Wed, 7 Nov 2018 15:41:28 +0000 (18:41 +0300)]
Added njs_vm_retval_dump().

7 years agoFixed accumulative flag in CLI file mode.
Dmitry Volyntsev [Wed, 7 Nov 2018 15:41:25 +0000 (18:41 +0300)]
Fixed accumulative flag in CLI file mode.

7 years agoInitializing closure values of a function.
Dmitry Volyntsev [Tue, 6 Nov 2018 17:57:53 +0000 (20:57 +0300)]
Initializing closure values of a function.

This fixes #55 issue on Github.

7 years agoUsing more approprite name for undefined value in exceptions.
Dmitry Volyntsev [Tue, 6 Nov 2018 17:57:52 +0000 (20:57 +0300)]
Using more approprite name for undefined value in exceptions.

7 years agoImproved wording for "not a function" exception.
Dmitry Volyntsev [Tue, 6 Nov 2018 17:30:49 +0000 (20:30 +0300)]
Improved wording for "not a function" exception.

7 years agoFixed description for explicit_bzero script.
Dmitry Volyntsev [Wed, 31 Oct 2018 13:06:06 +0000 (16:06 +0300)]
Fixed description for explicit_bzero script.

7 years agoVersion bump.
Dmitry Volyntsev [Tue, 30 Oct 2018 11:22:20 +0000 (14:22 +0300)]
Version bump.

7 years agoAdded tag 0.2.5 for changeset 3315f6aa6000
Dmitry Volyntsev [Tue, 30 Oct 2018 11:20:31 +0000 (14:20 +0300)]
Added tag 0.2.5 for changeset 3315f6aa6000

7 years agoVersion 0.2.5. 0.2.5
Dmitry Volyntsev [Tue, 30 Oct 2018 11:16:39 +0000 (14:16 +0300)]
Version 0.2.5.

7 years agoNon-integer fractions.
Valentin Bartenev [Mon, 29 Oct 2018 18:06:24 +0000 (21:06 +0300)]
Non-integer fractions.

7 years agoStream: marking incoming chain as processed.
Dmitry Volyntsev [Mon, 29 Oct 2018 14:36:43 +0000 (17:36 +0300)]
Stream: marking incoming chain as processed.

Previously, the buffers of proxy module were not reclaimed.
This resulted in stopping the processing of new data chunks from
a client after proxy_buffer_size bytes were received.

7 years agoAdded arguments object.
Dmitry Volyntsev [Tue, 23 Oct 2018 17:40:08 +0000 (20:40 +0300)]
Added arguments object.

This closes #19 issue on Github.

7 years agoHandling non-array values in Array.prototype.slice.
Dmitry Volyntsev [Tue, 23 Oct 2018 17:40:02 +0000 (20:40 +0300)]
Handling non-array values in Array.prototype.slice.

7 years agoHandling int overflow in njs_array_alloc() on 32bit archs.
Dmitry Volyntsev [Fri, 19 Oct 2018 17:55:38 +0000 (20:55 +0300)]
Handling int overflow in njs_array_alloc() on 32bit archs.

7 years agoAdded njs_string_slice_string_prop().
Dmitry Volyntsev [Fri, 19 Oct 2018 17:55:33 +0000 (20:55 +0300)]
Added njs_string_slice_string_prop().

7 years agoAdded njs_primitive_value_to_number().
Dmitry Volyntsev [Fri, 19 Oct 2018 17:55:30 +0000 (20:55 +0300)]
Added njs_primitive_value_to_number().

7 years agoFixed Object.prototype.hasOwnProperty() for non-object properties.
Dmitry Volyntsev [Fri, 19 Oct 2018 17:55:23 +0000 (20:55 +0300)]
Fixed Object.prototype.hasOwnProperty() for non-object properties.

This fixes #9 issue on Github.

7 years agodelete operator refactored.
Dmitry Volyntsev [Fri, 19 Oct 2018 17:54:59 +0000 (20:54 +0300)]
delete operator refactored.

7 years agoObject property quering is refactored.
Dmitry Volyntsev [Fri, 19 Oct 2018 17:52:57 +0000 (20:52 +0300)]
Object property quering is refactored.

    njs_property_query() is rectified and unified
        1) returns only property descriptors. Special return codes
        NJS_PRIMITIVE_VALUE, NJS_STRING_VALUE, NJS_ARRAY_VALUE and
        NJS_EXTERNAL_VALUE are replaced with a temporary property
        descriptor of type NJS_PROPERTY_REF or NJS_PROPERTY_HANDLER.
        If NJS_PROPERTY_REF is set reference to a value is contained
        in prop->value.data.u.value.

        2) NJS_PROPERTY_HANDLER properties returned as is.

        3) njs_property_query_t.own can be used to query for an object's
            OwnProperty.

        4) NJS_PROPERTY_QUERY_IN is removed.

        The aim is to implement with it [[GetOwnProperty]] and
        [[GetProperty]] methods from specification. Which are used
        extensively in many places of the ECMAScript spec.

    njs_value_property() is introduced which corresponds to [[Get]]
    method from specification.

    This fixes #32 and #34 issues on Github.

7 years agoUpdated documentation link.
Igor Sysoev [Sat, 6 Oct 2018 14:52:40 +0000 (17:52 +0300)]
Updated documentation link.

7 years agoStream: fixed counting pending events.
Dmitry Volyntsev [Thu, 4 Oct 2018 17:45:40 +0000 (20:45 +0300)]
Stream: fixed counting pending events.

Previously, erroneous messages 'pending events' were reported
to error log.

7 years agoStream: fixed s.off().
Dmitry Volyntsev [Thu, 4 Oct 2018 17:43:25 +0000 (20:43 +0300)]
Stream: fixed s.off().

Previously, s.off() did not delete the event in njs vm
using njs_vm_del_event().

7 years agoFixed default implementation for nxt_explicit_memzero().
Dmitry Volyntsev [Wed, 3 Oct 2018 12:38:19 +0000 (15:38 +0300)]
Fixed default implementation for nxt_explicit_memzero().

Thanks to David CARLIER.

7 years agoRemoved useless casting to void for explicit_bzero().
Dmitry Volyntsev [Wed, 3 Oct 2018 12:36:36 +0000 (15:36 +0300)]
Removed useless casting to void for explicit_bzero().

7 years agoImproved time zone tests for Date object.
Dmitry Volyntsev [Tue, 2 Oct 2018 17:34:30 +0000 (20:34 +0300)]
Improved time zone tests for Date object.

On some platforms, for example Alpine Linux, non-UTC timezones are
unavailable.

The fix is to use UTC timezone by default, and use a separate test suite
for the original timezone if it is available.

7 years agoAdded nxt_memset().
Dmitry Volyntsev [Tue, 2 Oct 2018 17:33:14 +0000 (20:33 +0300)]
Added nxt_memset().

7 years agoAdded nxt_memzero() and nxt_explicit_memzero().
Dmitry Volyntsev [Tue, 2 Oct 2018 17:28:10 +0000 (20:28 +0300)]
Added nxt_memzero() and nxt_explicit_memzero().

Thanks to David CARLIER.

7 years agoFixed http response and parent getters.
Dmitry Volyntsev [Thu, 27 Sep 2018 14:37:55 +0000 (17:37 +0300)]
Fixed http response and parent getters.

Getters are expected to set resulting value to the provided
argument, not to vm->retval.

7 years agoFixed code size mismatch error message.
Dmitry Volyntsev [Thu, 27 Sep 2018 14:36:38 +0000 (17:36 +0300)]
Fixed code size mismatch error message.

7 years agoFixed http status and contentType getter.
Dmitry Volyntsev [Wed, 19 Sep 2018 16:36:00 +0000 (19:36 +0300)]
Fixed http status and contentType getter.

Getter are expected to set resulting value to provied
argument, not to vm->retval.

7 years agoFixed njs_array_alloc() for length > 2**31.
Dmitry Volyntsev [Wed, 19 Sep 2018 16:24:07 +0000 (19:24 +0300)]
Fixed njs_array_alloc() for length > 2**31.

7 years agoFixed Array.prototype.length setter.
Dmitry Volyntsev [Wed, 19 Sep 2018 16:24:05 +0000 (19:24 +0300)]
Fixed Array.prototype.length setter.

7 years agoVersion bump.
Dmitry Volyntsev [Wed, 19 Sep 2018 11:43:58 +0000 (14:43 +0300)]
Version bump.

7 years agoAdded tag 0.2.4 for changeset 3e6c38f64bdb
Dmitry Volyntsev [Tue, 18 Sep 2018 12:14:06 +0000 (15:14 +0300)]
Added tag 0.2.4 for changeset 3e6c38f64bdb

7 years agoVersion 0.2.4. 0.2.4
Dmitry Volyntsev [Tue, 18 Sep 2018 12:13:41 +0000 (15:13 +0300)]
Version 0.2.4.

7 years agoFixed String.slice() for undefined arguments.
Dmitry Volyntsev [Mon, 17 Sep 2018 15:47:00 +0000 (18:47 +0300)]
Fixed String.slice() for undefined arguments.

7 years agoFixed njs_string_slice().
Dmitry Volyntsev [Fri, 14 Sep 2018 11:19:03 +0000 (14:19 +0300)]
Fixed njs_string_slice().

dst retval argument was ignored.

7 years agoAdded njs_uint32_to_string().
Dmitry Volyntsev [Thu, 13 Sep 2018 15:46:02 +0000 (18:46 +0300)]
Added njs_uint32_to_string().

7 years agoIntroduced sandboxing mode.
Dmitry Volyntsev [Thu, 13 Sep 2018 12:52:17 +0000 (15:52 +0300)]
Introduced sandboxing mode.

Thanks to David CARLIER.

7 years agoFixed macro for aligned size of njs_frame_t struct.
Dmitry Volyntsev [Tue, 11 Sep 2018 12:35:27 +0000 (15:35 +0300)]
Fixed macro for aligned size of njs_frame_t struct.

NJS_FRAME_SIZE did not take into account the variable length of
closures array.  This can result in overlapping addresses for
native_frame->arguments and frame->closures[n],

7 years agoNginx stream module refactored.
Dmitry Volyntsev [Tue, 11 Sep 2018 12:34:50 +0000 (15:34 +0300)]
Nginx stream module refactored.

The module handlers are refactored to make them similar to the HTTP
ones. This change is not backward compatible with the existing njs code.

To allow asynchronous operations the model of evaluation of njs handlers
is changed. A handler function (which is set for a corresponding nginx
directive) is invoked only once. It can register a callback if more data
is necessary, by calling s.on(<event_name>, <callback>). Available
events:
    upload - new data from a client.
    download - new data from an upstream.

Callback prototype:
    callback(data, flags).
    data - string.
    flags - object.
        Available properties:
            last - boolean, data is a last buffer.

A callback can be deregistered by s.off(<event_name>).

Return codes are replaced with special methods: s.allow(), s.deny(),
s.done().
    s.done([code]) (s.OK), can be used to return arbitrary code.
    s.allow() (s.OK)
    s.deny() (s.ABORT)

In addition, s.decline() method is added to allow handlers to stop
processing of the current handler and pass control to the next
handler of the current phase.

A handler is expected to invoke one of these methods when the
processing is done.

For example js_preread can wait for additional data by registering
a callback which will be called whenever new incoming data appears.

function js_preread(s) {
    s.on('upload', function(data, flags) {
            // process data

            // to proceed to the next phase
            s.done()

            // to proceed to next handler
            // of the current phase
            s.decline()
    })
}

js_filter handler is refactored.
    1) The current data chunk is moved from s.buffer to
        the callback argument.
    2) s.fromUpstream is removed.
    3)  The properties related to the current data chunk
        (s.eof) are put into the second callback argument.
        s.eof is renamed to flags.last.
    3) s.send(data[, opts]) is added to replace s.buffer = data;
        opts - object, can be used to override nginx buffer flags
            derived from an incoming data chunk buffer.
            It can contain boolean flags: last, flush.
    4) data toward corresponding direction is not forwarded
        if a callback is active, a callback is expected to
        call s.send(data, flags) if it wants to pass data
        as is.

    5) s.send() can be called multiple times per callback invocation.

    function stream_filter(s) {

        s.on('upload', function (data, flags) {
                // process a data chunk from a client

                // stop filtering data
                s.off('upload')
            })

        s.on('download', function (data, flags) {
                // process data from upstream

                // send my_data as the last buffer.
                s.send(my_data, {last:1});
            })
    }

7 years agoAdded njs_vm_object_alloc().
Dmitry Volyntsev [Tue, 11 Sep 2018 12:34:48 +0000 (15:34 +0300)]
Added njs_vm_object_alloc().

7 years agoAllowing to create repeatable events.
Dmitry Volyntsev [Tue, 11 Sep 2018 12:34:25 +0000 (15:34 +0300)]
Allowing to create repeatable events.

njs_vm_add_event() prototype is extended to allow creating
oneshot vs repeatable events.

7 years agoFixed compilation with gcc 4.4.
Dmitry Volyntsev [Mon, 3 Sep 2018 11:29:52 +0000 (14:29 +0300)]
Fixed compilation with gcc 4.4.

This fixes #49 issue on Github.

7 years agoImproved wording for InternalError messages.
Dmitry Volyntsev [Fri, 31 Aug 2018 13:55:35 +0000 (16:55 +0300)]
Improved wording for InternalError messages.

7 years agoImproved handling of traps inside trap handlers.
Dmitry Volyntsev [Thu, 30 Aug 2018 17:21:43 +0000 (20:21 +0300)]
Improved handling of traps inside trap handlers.

7 years agoFixed comparison of objects and strings.
Dmitry Volyntsev [Thu, 30 Aug 2018 17:21:18 +0000 (20:21 +0300)]
Fixed comparison of objects and strings.

7 years agoImproved Object.prototype.toString for invalid values.
Dmitry Volyntsev [Thu, 30 Aug 2018 14:21:51 +0000 (17:21 +0300)]
Improved Object.prototype.toString for invalid values.

7 years agoFixed Object() constructor for object types arguments.
Dmitry Volyntsev [Wed, 29 Aug 2018 17:32:11 +0000 (20:32 +0300)]
Fixed Object() constructor for object types arguments.

7 years agoFixed Object.prototype.toString for different value types.
Dmitry Volyntsev [Wed, 29 Aug 2018 17:31:43 +0000 (20:31 +0300)]
Fixed Object.prototype.toString for different value types.

7 years agoFixed exception handling in arguments of a function.
Dmitry Volyntsev [Tue, 28 Aug 2018 15:42:43 +0000 (18:42 +0300)]
Fixed exception handling in arguments of a function.

7 years agoFixed out-of-bounds read.
Dmitry Volyntsev [Tue, 28 Aug 2018 12:37:14 +0000 (15:37 +0300)]
Fixed out-of-bounds read.

Found by Coverity (CID 1438786).

7 years agoAdded Function.prototype.length.
Dmitry Volyntsev [Mon, 27 Aug 2018 16:19:25 +0000 (19:19 +0300)]
Added Function.prototype.length.

7 years agoRespecting writable attribute for property handlers.
Dmitry Volyntsev [Mon, 27 Aug 2018 13:37:42 +0000 (16:37 +0300)]
Respecting writable attribute for property handlers.

7 years agoRespecting the enumerable attribute while iterating by for in.
Dmitry Volyntsev [Mon, 27 Aug 2018 13:37:35 +0000 (16:37 +0300)]
Respecting the enumerable attribute while iterating by for in.

7 years agoFixed Object.defineProperty() for existing properties.
Dmitry Volyntsev [Mon, 27 Aug 2018 13:23:08 +0000 (16:23 +0300)]
Fixed Object.defineProperty() for existing properties.

This fixes #46 issues on Github.

7 years agoFixed toString() for -0.
Dmitry Volyntsev [Mon, 27 Aug 2018 13:06:33 +0000 (16:06 +0300)]
Fixed toString() for -0.

7 years agoThrowing TypeError for attempts to change frozen properties.
Dmitry Volyntsev [Mon, 27 Aug 2018 11:59:59 +0000 (14:59 +0300)]
Throwing TypeError for attempts to change frozen properties.

This fixes #35 issue on Github.

7 years agoImproved wording for primitive type conversion exception.
Dmitry Volyntsev [Mon, 20 Aug 2018 15:58:03 +0000 (18:58 +0300)]
Improved wording for primitive type conversion exception.

7 years agoSetting exception values where appropriate.
Dmitry Volyntsev [Thu, 2 Aug 2018 16:39:55 +0000 (19:39 +0300)]
Setting exception values where appropriate.

This fixes #42 issue on Github.

7 years agoReturning an internal error for not-implemented Function().
Dmitry Volyntsev [Wed, 1 Aug 2018 15:37:15 +0000 (18:37 +0300)]
Returning an internal error for not-implemented Function().

This fixes #41 issue on GitHub.

7 years agoAdding const qualifiers njs_value_t arguments of public methods.
Dmitry Volyntsev [Wed, 1 Aug 2018 15:05:01 +0000 (18:05 +0300)]
Adding const qualifiers njs_value_t arguments of public methods.

This allows to use the result of safe njs_arg() macro in the
methods.

7 years agoFixed error code typo introduced in 5f00966ffff8.
Dmitry Volyntsev [Tue, 31 Jul 2018 18:11:44 +0000 (21:11 +0300)]
Fixed error code typo introduced in 5f00966ffff8.

7 years agoImproved JSON.stringify() for external values.
Dmitry Volyntsev [Tue, 31 Jul 2018 12:30:01 +0000 (15:30 +0300)]
Improved JSON.stringify() for external values.

7 years agoAdded tag 0.2.3 for changeset e83f41520613
Dmitry Volyntsev [Tue, 31 Jul 2018 11:45:16 +0000 (14:45 +0300)]
Added tag 0.2.3 for changeset e83f41520613

7 years agoVersion bump.
Dmitry Volyntsev [Tue, 31 Jul 2018 11:33:01 +0000 (14:33 +0300)]
Version bump.

7 years agoVersion 0.2.3. 0.2.3
Dmitry Volyntsev [Tue, 31 Jul 2018 11:32:34 +0000 (14:32 +0300)]
Version 0.2.3.

7 years agoFixed applying call() to methods of external values.
Dmitry Volyntsev [Mon, 30 Jul 2018 17:00:31 +0000 (20:00 +0300)]
Fixed applying call() to methods of external values.

This correctly fixes #20 on Github.

7 years agoMaking njs_arg() available for external value methods.
Dmitry Volyntsev [Mon, 30 Jul 2018 17:00:20 +0000 (20:00 +0300)]
Making njs_arg() available for external value methods.

7 years agoAdded the pretty string representation for values.
Dmitry Volyntsev [Fri, 27 Jul 2018 14:01:52 +0000 (17:01 +0300)]
Added the pretty string representation for values.

Interactive shell: dumping the pretty string representation of
the last expression.

>> [1, new Number(2), {a: new String('αβZγ')}, true, console.log,
    /^undef$/m, new Date(0)]
[
 1,
 [Number: 2],
 {
  a: [String: 'αβZγ']
 },
 true,
 [Function: native],
 /^undef$/m,
 1970-01-01T00:00:00.000Z
]

njs.dump(value[, indent]):
    Returns the pretty string representation of a value.
    value - a value of any type.
    indent - a number.
        A number of space characters per indentation level.

    njs.dump({a:[]}) -> '{a:[]}'
    njs.dump({a:[]}, 1) -> '{\n a: [\n  \n ]\n}'

console.log([value1[, values]])
    Prints to stdout the flat pretty string representation
    of values (no new lines).

console.dump([value1[, values]])
    Prints to stdout the pretty string representation of values.

This fixes #11 issue on GitHub.

7 years agoFixed addition operator applied to an object.
Igor Sysoev [Tue, 24 Jul 2018 16:50:02 +0000 (19:50 +0300)]
Fixed addition operator applied to an object.

This fixes #36 issue on Github.

7 years agoRefactored trap infrastructure.
Igor Sysoev [Tue, 24 Jul 2018 16:50:02 +0000 (19:50 +0300)]
Refactored trap infrastructure.

This change allows to introduce virtually unlimited number of traps.

7 years agoRemoved artifacts left after changeset 25bd2742a18b.
Igor Sysoev [Tue, 24 Jul 2018 16:50:02 +0000 (19:50 +0300)]
Removed artifacts left after changeset 25bd2742a18b.

7 years agoFixed configure process with non-default locale.
Valentin Bartenev [Tue, 24 Jul 2018 16:25:39 +0000 (19:25 +0300)]
Fixed configure process with non-default locale.

Overriding LANG might not work, since it has less precedence than LC_* settings.
LC_ALL has the highest precedence.

7 years agoFixed typo in njs_arg_type_string() for NJS_DATE_ARG.
Dmitry Volyntsev [Tue, 24 Jul 2018 15:29:25 +0000 (18:29 +0300)]
Fixed typo in njs_arg_type_string() for NJS_DATE_ARG.

7 years agoRestricted usage of r.subrequest() and r.parent.
Dmitry Volyntsev [Mon, 23 Jul 2018 15:04:53 +0000 (18:04 +0300)]
Restricted usage of r.subrequest() and r.parent.

Thanks to 洪志道 (Hong Zhi Dao).

7 years agoBacked out changeset 552da720e6e6.
Dmitry Volyntsev [Mon, 23 Jul 2018 13:35:32 +0000 (16:35 +0300)]
Backed out changeset 552da720e6e6.

The original code was correct, the (int) casting does not change
anything because the type of the '0' literal is int. The solution to the
original problem is to mark CID 1438046 as false-positive.

7 years agoImproved help desrcription of njs shell.
Dmitry Volyntsev [Fri, 20 Jul 2018 17:11:02 +0000 (20:11 +0300)]
Improved help desrcription of njs shell.

7 years agoSilenced Coverity false-positive warning (CID 1438046).
Dmitry Volyntsev [Fri, 20 Jul 2018 13:09:50 +0000 (16:09 +0300)]
Silenced Coverity false-positive warning (CID 1438046).

7 years agoFixed compilation by gcc 4.2.
Dmitry Volyntsev [Fri, 20 Jul 2018 12:59:59 +0000 (15:59 +0300)]
Fixed compilation by gcc 4.2.

7 years agoFixed Number.toString().
Dmitry Volyntsev [Thu, 19 Jul 2018 15:11:52 +0000 (18:11 +0300)]
Fixed Number.toString().

Adding correct dtoa() and strtod() realization.

This fixes #28 and #30 issues on GitHub.

7 years agoString.bytesFrom() method.
Dmitry Volyntsev [Wed, 18 Jul 2018 12:41:55 +0000 (15:41 +0300)]
String.bytesFrom() method.

The method creates a byte string from an array containing octets:
    String.bytesFrom(array).

The method creates a byte string from an encoded string:
    String.bytesFrom(string, encoding)
where encoding are "hex", "base64", "base64url".

This closes #2 issue on Github.