コード例 #1
0
/* Float64Array, "partial slice" */
static duk_ret_t test_float64array_indexed_1b(duk_context *ctx) {
	duk_push_dynamic_buffer(ctx, 1200);
	setup_typedarray_slice(ctx, -1, "Float64Array", 240, 100);
	shared_read_write_index(ctx, 240 + 95 * 8);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}
コード例 #2
0
/* Float32Array, "full slice" */
static duk_ret_t test_float32array_indexed_1a(duk_context *ctx) {
	duk_push_dynamic_buffer(ctx, 400);
	setup_typedarray(ctx, -1, "Float32Array");
	shared_read_write_index(ctx, 95 * 4);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}
コード例 #3
0
/* Uint32Array, "partial slice" */
static duk_ret_t test_uint32array_indexed_1b(duk_context *ctx) {
	duk_push_dynamic_buffer(ctx, 600);
	setup_typedarray_slice(ctx, -1, "Uint32Array", 120, 100);
	shared_read_write_index(ctx, 120 + 95 * 4);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}
コード例 #4
0
/* ArrayBuffer, "full slice" */
static duk_ret_t test_arraybuffer_indexed_1a(duk_context *ctx) {
	duk_push_dynamic_buffer(ctx, 100);
	setup_arraybuffer(ctx, -1);
	shared_read_write_index(ctx, 95);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}
コード例 #5
0
/* Node.js Buffer, "partial slice" */
static duk_ret_t test_nodejs_buffer_indexed_1b(duk_context *ctx) {
	duk_push_dynamic_buffer(ctx, 150);
	setup_nodejs_buffer_slice(ctx, -1, 30, 130);
	shared_read_write_index(ctx, 30 + 95);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}
コード例 #6
0
/* Float64Array, "full slice" */
static duk_ret_t test_float64array_indexed_1a(duk_context *ctx, void *udata) {
	(void) udata;

	duk_push_dynamic_buffer(ctx, 800);
	setup_typedarray(ctx, -1, "Float64Array");
	shared_read_write_index(ctx, 95 * 8);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}
コード例 #7
0
/* Uint16Array, "partial slice" */
static duk_ret_t test_uint16array_indexed_1b(duk_context *ctx, void *udata) {
	(void) udata;

	duk_push_dynamic_buffer(ctx, 300);
	setup_typedarray_slice(ctx, -1, "Uint16Array", 60, 100);
	shared_read_write_index(ctx, 60 + 95 * 2);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}
コード例 #8
0
/* Node.js Buffer, "full slice" */
static duk_ret_t test_nodejs_buffer_indexed_1a(duk_context *ctx, void *udata) {
	(void) udata;

	duk_push_dynamic_buffer(ctx, 100);
	setup_nodejs_buffer(ctx, -1);
	shared_read_write_index(ctx, 95);

	printf("final top: %ld\n", (long) duk_get_top(ctx));
	return 0;
}