Lucas Stadler лет назад: 9
Родитель
Сommit
7b00df2c3d
1 измененных файлов с 3 добавлено и 5 удалено
  1. 3 5
      c/ton/main.c

+ 3 - 5
c/ton/main.c

91
		JSStringGetUTF8CString(path_str, path, 100);
91
		JSStringGetUTF8CString(path_str, path, 100);
92
		JSStringRelease(path_str);
92
		JSStringRelease(path_str);
93
93
94
		debug_print_value
95
	("read_file", ctx, args[0]);
94
		debug_print_value("read_file", ctx, args[0]);
96
95
97
		char full_path[150];
96
		char full_path[150];
98
		// TODO: should not load from here?
97
		// TODO: should not load from here?
124
		JSStringGetUTF8CString(path_str, path, 100);
123
		JSStringGetUTF8CString(path_str, path, 100);
125
		JSStringRelease(path_str);
124
		JSStringRelease(path_str);
126
125
127
		debug_print_value
128
	("load", ctx, args[0]);
126
		debug_print_value("load", ctx, args[0]);
129
127
130
		char full_path[150];
128
		char full_path[150];
131
		// TODO: should not load from here?
129
		// TODO: should not load from here?
214
	if (argc == 2
212
	if (argc == 2
215
		&& JSValueGetType(ctx, args[0]) == kJSTypeString
213
		&& JSValueGetType(ctx, args[0]) == kJSTypeString
216
		&& JSValueGetType(ctx, args[1]) == kJSTypeString) {
214
		&& JSValueGetType(ctx, args[1]) == kJSTypeString) {
217
		debug_print_value("eval", ctx, args[1]);
215
		debug_print_value("eval", ctx, args[0]);
218
216
219
		JSStringRef sourceRef = JSValueToStringCopy(ctx, args[0], NULL);
217
		JSStringRef sourceRef = JSValueToStringCopy(ctx, args[0], NULL);
220
		JSStringRef pathRef = JSValueToStringCopy(ctx, args[1], NULL);
218
		JSStringRef pathRef = JSValueToStringCopy(ctx, args[1], NULL);