Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
73 lines (56 loc) · 1.81 KB

File metadata and controls

73 lines (56 loc) · 1.81 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "devs_internal.h"
void fun2_Object_assign(devs_ctx_t *ctx) {
value_t dst0 = devs_arg(ctx, 0);
value_t src0 = devs_arg(ctx, 1);
if (!devs_is_nullish(src0)) {
devs_map_t *dst = devs_object_get_attached_rw(ctx, dst0);
devs_maplike_t *src = devs_object_get_attached_enum(ctx, src0);
if (src && dst)
devs_map_copy_into(ctx, dst, src);
}
devs_ret(ctx, dst0);
}
static void fun1_keys_or_values(devs_ctx_t *ctx, bool keys) {
value_t src0 = devs_arg(ctx, 0);
devs_maplike_t *src = devs_object_get_attached_enum(ctx, src0);
if (!src)
return;
devs_array_t *arr = devs_array_try_alloc(ctx, 0);
if (!arr)
return;
value_t ret = devs_value_from_gc_obj(ctx, arr);
devs_value_pin(ctx, ret);
devs_maplike_keys_or_values(ctx, src, arr, keys);
devs_value_unpin(ctx, ret);
devs_ret(ctx, ret);
}
void fun1_Object_keys(devs_ctx_t *ctx) {
fun1_keys_or_values(ctx, 1);
}
void fun1_Object_values(devs_ctx_t *ctx) {
fun1_keys_or_values(ctx, 0);
}
void fun2_Object_setPrototypeOf(devs_ctx_t *ctx) {
value_t trg = devs_arg(ctx, 0);
value_t src = devs_arg(ctx, 1);
devs_map_t *m = devs_value_to_gc_obj(ctx, trg);
if (!devs_is_map(m)) {
devs_throw_expecting_error(ctx, DEVS_BUILTIN_STRING_OBJECT, trg);
return;
}
devs_maplike_t *p = devs_object_get_attached_enum(ctx, src);
if (!p) {
devs_throw_expecting_error(ctx, DEVS_BUILTIN_STRING_PROTOTYPE, src);
return;
}
m->proto = p;
devs_ret(ctx, trg);
}
void meth1_Object___ctor__(devs_ctx_t *ctx) {
value_t self = devs_arg_self(ctx);
value_t value = devs_arg(ctx, 0);
if (devs_is_null_or_undefined(value))
devs_ret(ctx, self); // self should be already an object
else
devs_ret(ctx, value);
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.