From 562bb315b87685ab6f59dcd1ff3fbf0a39cec467 Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Thu, 22 Dec 2016 04:31:44 +0200 Subject: [PATCH] String.fromBuffer -> String.fromBufferRaw in duk --- examples/cmdline/duk_cmdline.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/cmdline/duk_cmdline.c b/examples/cmdline/duk_cmdline.c index f5613b6f..09957897 100644 --- a/examples/cmdline/duk_cmdline.c +++ b/examples/cmdline/duk_cmdline.c @@ -970,10 +970,10 @@ static duk_ret_t fileio_write_file(duk_context *ctx) { #endif /* DUK_CMDLINE_FILEIO */ /* - * String.fromBuffer() + * String.fromBufferRaw() */ -static duk_ret_t string_frombuffer(duk_context *ctx) { +static duk_ret_t string_frombufferraw(duk_context *ctx) { duk_buffer_to_string(ctx, 0); return 1; } @@ -1142,8 +1142,8 @@ static duk_context *create_duktape_heap(int alloc_provider, int debugger, int aj duk_print_alert_init(ctx, 0 /*flags*/); #endif - /* Register String.fromBuffer() which does a 1:1 buffer-to-string - * coercion needed by testcases. String.fromBuffer() is -not- a + /* Register String.fromBufferRaw() which does a 1:1 buffer-to-string + * coercion needed by testcases. String.fromBufferRaw() is -not- a * default built-in! For stripped builds the 'String' built-in * doesn't exist and we create it here; for ROM builds it may be * present but unwritable (which is ignored). @@ -1151,9 +1151,9 @@ static duk_context *create_duktape_heap(int alloc_provider, int debugger, int aj duk_eval_string(ctx, "(function(v){" "if (typeof String === 'undefined') { String = {}; }" - "Object.defineProperty(String, 'fromBuffer', {value:v, configurable:true});" + "Object.defineProperty(String, 'fromBufferRaw', {value:v, configurable:true});" "})"); - duk_push_c_function(ctx, string_frombuffer, 1 /*nargs*/); + duk_push_c_function(ctx, string_frombufferraw, 1 /*nargs*/); (void) duk_pcall(ctx, 1); duk_pop(ctx);