Compare commits
10 Commits
stack
...
tramp_loop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7af8ffe4e0 | ||
|
|
8abee37622 | ||
|
|
7c3cce1ce2 | ||
|
|
334f3a789b | ||
|
|
e21cd4e70b | ||
|
|
41eb4bf6f7 | ||
|
|
5f761cc7af | ||
|
|
7ae5a0c06b | ||
|
|
0664c11af6 | ||
|
|
058ad89c96 |
@@ -808,7 +808,6 @@ if (!locator)
|
||||
stone(globalThis)
|
||||
|
||||
var rads = use_core("math/radians")
|
||||
log.console(rads)
|
||||
|
||||
$_.clock(_ => {
|
||||
// Get capabilities for the main program
|
||||
|
||||
@@ -74,7 +74,7 @@ foreach file: scripts
|
||||
endforeach
|
||||
|
||||
srceng = 'source'
|
||||
includes = [srceng, 'internal', 'debug', 'net', 'archive', 'math']
|
||||
includes = [srceng, 'internal', 'debug', 'net', 'archive']
|
||||
|
||||
foreach file : src
|
||||
full_path = join_paths(srceng, file)
|
||||
|
||||
@@ -28,6 +28,10 @@
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
struct list_head {
|
||||
struct list_head *prev;
|
||||
struct list_head *next;
|
||||
@@ -82,6 +86,29 @@ static inline int list_empty(struct list_head *el)
|
||||
return el->next == el;
|
||||
}
|
||||
|
||||
/* Move all elements from 'src' to 'dst', leaving 'src' empty.
|
||||
'dst' must be empty before this call. */
|
||||
static inline void list_splice(struct list_head *dst, struct list_head *src)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
assert(dst != src);
|
||||
assert(list_empty(dst));
|
||||
#endif
|
||||
if (!list_empty(src)) {
|
||||
struct list_head *first = src->next;
|
||||
struct list_head *last = src->prev;
|
||||
|
||||
/* Link dst to src's elements */
|
||||
dst->next = first;
|
||||
dst->prev = last;
|
||||
first->prev = dst;
|
||||
last->next = dst;
|
||||
|
||||
/* Reinitialize src as empty */
|
||||
init_list_head(src);
|
||||
}
|
||||
}
|
||||
|
||||
#define list_for_each(el, head) \
|
||||
for(el = (head)->next; el != (head); el = el->next)
|
||||
|
||||
|
||||
@@ -207,10 +207,14 @@ DEF( delete, 1, 2, 1, none)
|
||||
DEF( delete_var, 5, 0, 1, atom)
|
||||
|
||||
DEF( mul, 1, 2, 1, none)
|
||||
DEF( mul_float, 1, 2, 1, none)
|
||||
DEF( div, 1, 2, 1, none)
|
||||
DEF( div_float, 1, 2, 1, none)
|
||||
DEF( mod, 1, 2, 1, none)
|
||||
DEF( add, 1, 2, 1, none)
|
||||
DEF( add_float, 1, 2, 1, none)
|
||||
DEF( sub, 1, 2, 1, none)
|
||||
DEF( sub_float, 1, 2, 1, none)
|
||||
DEF( pow, 1, 2, 1, none)
|
||||
DEF( shl, 1, 2, 1, none)
|
||||
DEF( sar, 1, 2, 1, none)
|
||||
|
||||
947
source/quickjs.c
947
source/quickjs.c
File diff suppressed because it is too large
Load Diff
@@ -145,26 +145,6 @@ return {
|
||||
if (!caught) throw "string + boolean should throw"
|
||||
},
|
||||
|
||||
test_null_plus_string_throws: function() {
|
||||
var caught = false
|
||||
try {
|
||||
var x = null + "hello"
|
||||
} catch (e) {
|
||||
caught = true
|
||||
}
|
||||
if (!caught) throw "null + string should throw"
|
||||
},
|
||||
|
||||
test_string_plus_null_throws: function() {
|
||||
var caught = false
|
||||
try {
|
||||
var x = "hello" + null
|
||||
} catch (e) {
|
||||
caught = true
|
||||
}
|
||||
if (!caught) throw "string + null should throw"
|
||||
},
|
||||
|
||||
// ============================================================================
|
||||
// COMPARISON OPERATORS
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user