Commit 17cb19ec authored by Jérémy Lal's avatar Jérémy Lal

Imported Upstream version 0.10.13~dfsg1

parent 827db2d3
......@@ -454,3 +454,5 @@ Rafael Henrique Moreira <rafadev7@gmail.com>
Daniel G. Taylor <dan@programmer-art.org>
Kiyoshi Nomo <tokyoincidents.g@gmail.com>
Veres Lajos <vlajos@gmail.com>
Yuan Chuan <yuanchuan23@gmail.com>
Peter Rust <peter@cornerstonenw.com>
2013.06.13, Version 0.10.11 (Stable)
2013.07.09, Version 0.10.13 (Stable)
* uv: Upgrade to v0.10.12
* npm: Upgrade to 1.3.2
* windows: get proper errno (Ben Noordhuis)
* tls: only wait for finish if we haven't seen it (Timothy J Fontaine)
* http: Dump response when request is aborted (isaacs)
* http: use an unref'd timer to fix delay in exit (Peter Rust)
* zlib: level can be negative (Brian White)
* zlib: allow zero values for level and strategy (Brian White)
* buffer: add comment explaining buffer alignment (Ben Noordhuis)
* string_bytes: properly detect 64bit (Timothy J Fontaine)
* src: fix memory leak in UsingDomains() (Ben Noordhuis)
2013.06.18, Version 0.10.12 (Stable)
* npm: Upgrade to 1.2.32
* readline: make `ctrl + L` clear the screen (Yuan Chuan)
* v8: add setVariableValue debugger command (Ben Noordhuis)
* net: Do not destroy socket mid-write (isaacs)
* v8: fix build for mips32r2 architecture (Andrei Sedoi)
* configure: fix cross-compilation host_arch_cc() (Andrei Sedoi)
2013.06.13, Version 0.10.11 (Stable), d9d5bc465450ae5d60da32e9ffcf71c2767f1fad
* uv: upgrade to 0.10.11
......@@ -736,6 +776,13 @@
* Fix #3521 Make process.env more like a regular Object (isaacs)
2013.06.13, Version 0.8.25 (maintenance), 0b9bdb2bc7e1c872f0ea4713517fda22a4b0b202
* npm: Upgrade to 1.2.30
* child_process: fix handle delivery (Ben Noordhuis)
2013.06.04, Version 0.8.24 (maintenance), c1a1ab067721ea17ef7b05ec5c68b01321017f05
* npm: Upgrade to v1.2.24
......
......@@ -84,3 +84,4 @@ Nicholas Vavilov <vvnicholas@gmail.com>
Miroslav Bajtoš <miro.bajtos@gmail.com>
Elliot Saba <staticfloat@gmail.com>
Wynn Wilkes <wynnw@movenetworks.com>
Andrei Sedoi <bsnote@gmail.com>
2013.06.13, Version 0.10.11 (Stable)
2013.07.10, Version 0.10.12 (Stable)
Changes since version 0.10.11:
* linux: add support for MIPS (Andrei Sedoi)
* windows: uv_spawn shouldn't reject reparse points (Bert Belder)
* windows: use WSAGetLastError(), not errno (Ben Noordhuis)
* build: darwin: disable -fstrict-aliasing warnings (Ben Noordhuis)
* build: `all` now builds static and dynamic lib (Ben Noordhuis)
* unix: fix build when !defined(PTHREAD_MUTEX_ERRORCHECK) (Ben Noordhuis)
2013.06.13, Version 0.10.11 (Stable), c3b75406a66a10222a589cb173e8f469e9665c7e
Changes since version 0.10.10:
......
......@@ -130,6 +130,7 @@ TESTS= \
test/test-threadpool.o \
test/test-threadpool-cancel.o \
test/test-timer-again.o \
test/test-timer-from-check.o \
test/test-timer.o \
test/test-tty.o \
test/test-udp-dgram-too-big.o \
......@@ -142,7 +143,7 @@ TESTS= \
test/test-util.o \
test/test-walk-handles.o \
all: libuv.a
.PHONY: all bench clean clean-platform distclean test
run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.a
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)
......@@ -152,10 +153,6 @@ run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMAR
test/echo.o: test/echo.c test/echo.h
.PHONY: clean clean-platform distclean test bench
test: run-tests$(E)
$(CURDIR)/$<
......
......@@ -222,7 +222,7 @@ SunOS)
;;
esac
for ARCH in __i386__ __x86_64__ __arm__; do
for ARCH in __i386__ __x86_64__ __arm__ __mips__; do
$SPARSE $SPARSE_FLAGS -D$ARCH=1 $SOURCES
done
......
......@@ -36,6 +36,7 @@
},
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0',
'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ],
},
'conditions': [
['OS != "win"', {
......
......@@ -29,7 +29,7 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64
RUNNER_SRC=test/runner-unix.c
RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test
RUNNER_LDFLAGS=-L"$(CURDIR)" -luv
RUNNER_LDFLAGS=
DTRACE_OBJS=
DTRACE_HEADER=
......@@ -159,6 +159,13 @@ endif
RUNNER_LDFLAGS += $(LDFLAGS)
all:
# Force a sequential build of the static and the shared library.
# Works around a make quirk where it forgets to (re)build either
# the *.o or *.pic.o files, depending on what target comes first.
$(MAKE) -f $(SRCDIR)/Makefile libuv.a
$(MAKE) -f $(SRCDIR)/Makefile libuv.$(SOEXT)
libuv.a: $(OBJS)
$(AR) rcs $@ $^
......
......@@ -24,6 +24,7 @@ def host_arch():
if machine == 'i386': return 'ia32'
if machine == 'x86_64': return 'x64'
if machine.startswith('arm'): return 'arm'
if machine.startswith('mips'): return 'mips'
return machine # Return as-is and hope for the best.
......
......@@ -427,7 +427,7 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
char* model;
FILE* fp;
/* Most are unused on non-ARM and non-x86 architectures. */
/* Most are unused on non-ARM, non-MIPS and non-x86 architectures. */
(void) &model_marker;
(void) &speed_marker;
(void) &speed_idx;
......@@ -438,7 +438,10 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
model_idx = 0;
speed_idx = 0;
#if defined(__arm__) || defined(__i386__) || defined(__x86_64__)
#if defined(__arm__) || \
defined(__i386__) || \
defined(__mips__) || \
defined(__x86_64__)
fp = fopen("/proc/cpuinfo", "r");
if (fp == NULL)
return -1;
......@@ -456,10 +459,14 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
continue;
}
}
#if defined(__arm__)
/* Fallback for pre-3.8 kernels. */
#if defined(__arm__) || defined(__mips__)
if (model_idx < numcpus) {
#if defined(__arm__)
/* Fallback for pre-3.8 kernels. */
static const char model_marker[] = "Processor\t: ";
#else /* defined(__mips__) */
static const char model_marker[] = "cpu model\t\t: ";
#endif
if (strncmp(buf, model_marker, sizeof(model_marker) - 1) == 0) {
model = buf + sizeof(model_marker) - 1;
model = strndup(model, strlen(model) - 1); /* Strip newline. */
......@@ -471,18 +478,18 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
continue;
}
}
#else /* !__arm____ */
#else /* !__arm__ && !__mips__ */
if (speed_idx < numcpus) {
if (strncmp(buf, speed_marker, sizeof(speed_marker) - 1) == 0) {
ci[speed_idx++].speed = atoi(buf + sizeof(speed_marker) - 1);
continue;
}
}
#endif /* __arm__ */
#endif /* __arm__ || __mips__ */
}
fclose(fp);
#endif /* __arm__ || __i386__ || __x86_64__ */
#endif /* __arm__ || __i386__ || __mips__ || __x86_64__ */
/* Now we want to make sure that all the models contain *something* because
* it's not safe to leave them as null. Copy the last entry unless there
......
......@@ -42,7 +42,7 @@ int uv_thread_join(uv_thread_t *tid) {
int uv_mutex_init(uv_mutex_t* mutex) {
#ifdef NDEBUG
#if defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
if (pthread_mutex_init(mutex, NULL))
return -1;
else
......
......@@ -34,7 +34,7 @@
#define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 11
#define UV_VERSION_PATCH 12
#define UV_VERSION_IS_RELEASE 1
......
......@@ -225,7 +225,7 @@ static WCHAR* search_path_join_test(const WCHAR* dir,
attrs = GetFileAttributesW(result);
if (attrs != INVALID_FILE_ATTRIBUTES &&
!(attrs & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT))) {
!(attrs & FILE_ATTRIBUTE_DIRECTORY)) {
return result;
}
......
......@@ -50,7 +50,7 @@ static int uv__tcp_nodelay(uv_tcp_t* handle, SOCKET socket, int enable) {
TCP_NODELAY,
(const char*)&enable,
sizeof enable) == -1) {
uv__set_sys_error(handle->loop, errno);
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
}
return 0;
......@@ -63,7 +63,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
SO_KEEPALIVE,
(const char*)&enable,
sizeof enable) == -1) {
uv__set_sys_error(handle->loop, errno);
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
}
......@@ -72,7 +72,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
TCP_KEEPALIVE,
(const char*)&delay,
sizeof delay) == -1) {
uv__set_sys_error(handle->loop, errno);
uv__set_sys_error(handle->loop, WSAGetLastError());
return -1;
}
......
......@@ -1391,7 +1391,8 @@ TEST_IMPL(fs_symlink_dir) {
#ifdef _WIN32
ASSERT(((struct stat*)req.ptr)->st_size == strlen(test_dir + 4));
#else
ASSERT(((struct stat*)req.ptr)->st_size == strlen(test_dir));
/* st_size has type off_t. Cast to avoid signed/unsigned warnings. */
ASSERT((size_t) ((struct stat*)req.ptr)->st_size == strlen(test_dir));
#endif
uv_fs_req_cleanup(&req);
......
......@@ -101,6 +101,7 @@ TEST_DECLARE (timer_start_twice)
TEST_DECLARE (timer_order)
TEST_DECLARE (timer_huge_timeout)
TEST_DECLARE (timer_huge_repeat)
TEST_DECLARE (timer_from_check)
TEST_DECLARE (idle_starvation)
TEST_DECLARE (loop_handles)
TEST_DECLARE (get_loadavg)
......@@ -348,6 +349,7 @@ TASK_LIST_START
TEST_ENTRY (timer_order)
TEST_ENTRY (timer_huge_timeout)
TEST_ENTRY (timer_huge_repeat)
TEST_ENTRY (timer_from_check)
TEST_ENTRY (idle_starvation)
......
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "uv.h"
#include "task.h"
static uv_prepare_t prepare_handle;
static uv_check_t check_handle;
static uv_timer_t timer_handle;
static int prepare_cb_called;
static int check_cb_called;
static int timer_cb_called;
static void prepare_cb(uv_prepare_t* handle, int status) {
ASSERT(0 == uv_prepare_stop(&prepare_handle));
ASSERT(0 == prepare_cb_called);
ASSERT(1 == check_cb_called);
ASSERT(0 == timer_cb_called);
prepare_cb_called++;
}
static void timer_cb(uv_timer_t* handle, int status) {
ASSERT(0 == uv_timer_stop(&timer_handle));
ASSERT(1 == prepare_cb_called);
ASSERT(1 == check_cb_called);
ASSERT(0 == timer_cb_called);
timer_cb_called++;
}
static void check_cb(uv_check_t* handle, int status) {
ASSERT(0 == uv_check_stop(&check_handle));
ASSERT(0 == uv_timer_stop(&timer_handle)); /* Runs before timer_cb. */
ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 50, 0));
ASSERT(0 == uv_prepare_start(&prepare_handle, prepare_cb));
ASSERT(0 == prepare_cb_called);
ASSERT(0 == check_cb_called);
ASSERT(0 == timer_cb_called);
check_cb_called++;
}
TEST_IMPL(timer_from_check) {
ASSERT(0 == uv_prepare_init(uv_default_loop(), &prepare_handle));
ASSERT(0 == uv_check_init(uv_default_loop(), &check_handle));
ASSERT(0 == uv_check_start(&check_handle, check_cb));
ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle));
ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 50, 0));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
ASSERT(1 == prepare_cb_called);
ASSERT(1 == check_cb_called);
ASSERT(1 == timer_cb_called);
uv_close((uv_handle_t*) &prepare_handle, NULL);
uv_close((uv_handle_t*) &check_handle, NULL);
uv_close((uv_handle_t*) &timer_handle, NULL);
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE));
MAKE_VALGRIND_HAPPY();
return 0;
}
......@@ -81,10 +81,10 @@ TEST_IMPL(tty) {
ASSERT(UV_TTY == uv_guess_handle(ttyin_fd));
ASSERT(UV_TTY == uv_guess_handle(ttyout_fd));
r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1);
r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */
ASSERT(r == 0);
r = uv_tty_init(uv_default_loop(), &tty_out, ttyout_fd, 2);
r = uv_tty_init(uv_default_loop(), &tty_out, ttyout_fd, 0); /* Writable. */
ASSERT(r == 0);
r = uv_tty_get_winsize(&tty_out, &width, &height);
......
......@@ -353,6 +353,7 @@
'test/test-barrier.c',
'test/test-condvar.c',
'test/test-timer-again.c',
'test/test-timer-from-check.c',
'test/test-timer.c',
'test/test-tty.c',
'test/test-udp-dgram-too-big.c',
......
......@@ -200,10 +200,11 @@
['mips_arch_variant=="mips32r2"', {
'cflags': ['-mips32r2', '-Wa,-mips32r2'],
}],
['mips_arch_variant=="mips32r1"', {
'cflags': ['-mips32', '-Wa,-mips32'],
}],
['mips_arch_variant=="loongson"', {
'cflags': ['-mips3', '-Wa,-mips3'],
}, {
'cflags': ['-mips32', '-Wa,-mips32'],
}],
],
}],
......
......@@ -1427,6 +1427,8 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(
this.scopesRequest_(request, response);
} else if (request.command == 'scope') {
this.scopeRequest_(request, response);
} else if (request.command == 'setVariableValue') {
this.setVariableValueRequest_(request, response);
} else if (request.command == 'evaluate') {
this.evaluateRequest_(request, response);
} else if (lol_is_enabled && request.command == 'getobj') {
......@@ -1953,11 +1955,12 @@ DebugCommandProcessor.prototype.frameRequest_ = function(request, response) {
};
DebugCommandProcessor.prototype.frameForScopeRequest_ = function(request) {
DebugCommandProcessor.prototype.resolveFrameFromScopeDescription_ =
function(scope_description) {
// Get the frame for which the scope or scopes are requested.
// With no frameNumber argument use the currently selected frame.
if (request.arguments && !IS_UNDEFINED(request.arguments.frameNumber)) {
frame_index = request.arguments.frameNumber;
if (scope_description && !IS_UNDEFINED(scope_description.frameNumber)) {
frame_index = scope_description.frameNumber;
if (frame_index < 0 || this.exec_state_.frameCount() <= frame_index) {
throw new Error('Invalid frame number');
}
......@@ -1971,13 +1974,13 @@ DebugCommandProcessor.prototype.frameForScopeRequest_ = function(request) {
// Gets scope host object from request. It is either a function
// ('functionHandle' argument must be specified) or a stack frame
// ('frameNumber' may be specified and the current frame is taken by default).
DebugCommandProcessor.prototype.scopeHolderForScopeRequest_ =
function(request) {
if (request.arguments && "functionHandle" in request.arguments) {
if (!IS_NUMBER(request.arguments.functionHandle)) {
DebugCommandProcessor.prototype.resolveScopeHolder_ =
function(scope_description) {
if (scope_description && "functionHandle" in scope_description) {
if (!IS_NUMBER(scope_description.functionHandle)) {
throw new Error('Function handle must be a number');
}
var function_mirror = LookupMirror(request.arguments.functionHandle);
var function_mirror = LookupMirror(scope_description.functionHandle);
if (!function_mirror) {
throw new Error('Failed to find function object by handle');
}
......@@ -1992,14 +1995,14 @@ DebugCommandProcessor.prototype.scopeHolderForScopeRequest_ =
}
// Get the frame for which the scopes are requested.
var frame = this.frameForScopeRequest_(request);
var frame = this.resolveFrameFromScopeDescription_(scope_description);
return frame;
}
}
DebugCommandProcessor.prototype.scopesRequest_ = function(request, response) {
var scope_holder = this.scopeHolderForScopeRequest_(request);
var scope_holder = this.resolveScopeHolder_(request.arguments);
// Fill all scopes for this frame or function.
var total_scopes = scope_holder.scopeCount();
......@@ -2018,7 +2021,7 @@ DebugCommandProcessor.prototype.scopesRequest_ = function(request, response) {
DebugCommandProcessor.prototype.scopeRequest_ = function(request, response) {
// Get the frame or function for which the scope is requested.
var scope_holder = this.scopeHolderForScopeRequest_(request);
var scope_holder = this.resolveScopeHolder_(request.arguments);
// With no scope argument just return top scope.
var scope_index = 0;
......@@ -2033,6 +2036,77 @@ DebugCommandProcessor.prototype.scopeRequest_ = function(request, response) {
};
// Reads value from protocol description. Description may be in form of type
// (for singletons), raw value (primitive types supported in JSON),
// string value description plus type (for primitive values) or handle id.
// Returns raw value or throws exception.
DebugCommandProcessor.resolveValue_ = function(value_description) {
if ("handle" in value_description) {
var value_mirror = LookupMirror(value_description.handle);
if (!value_mirror) {
throw new Error("Failed to resolve value by handle, ' #" +
mapping.handle + "# not found");
}
return value_mirror.value();
} else if ("stringDescription" in value_description) {
if (value_description.type == BOOLEAN_TYPE) {
return Boolean(value_description.stringDescription);
} else if (value_description.type == NUMBER_TYPE) {
return Number(value_description.stringDescription);
} if (value_description.type == STRING_TYPE) {
return String(value_description.stringDescription);
} else {
throw new Error("Unknown type");
}
} else if ("value" in value_description) {
return value_description.value;
} else if (value_description.type == UNDEFINED_TYPE) {
return void 0;
} else if (value_description.type == NULL_TYPE) {
return null;
} else {
throw new Error("Failed to parse value description");
}
};
DebugCommandProcessor.prototype.setVariableValueRequest_ =
function(request, response) {
if (!request.arguments) {
response.failed('Missing arguments');
return;
}
if (IS_UNDEFINED(request.arguments.name)) {
response.failed('Missing variable name');
}
var variable_name = request.arguments.name;
var scope_description = request.arguments.scope;
// Get the frame or function for which the scope is requested.
var scope_holder = this.resolveScopeHolder_(scope_description);
if (IS_UNDEFINED(scope_description.number)) {
response.failed('Missing scope number');
}
var scope_index = %ToNumber(scope_description.number);
var scope = scope_holder.scope(scope_index);
var new_value =
DebugCommandProcessor.resolveValue_(request.arguments.newValue);
scope.setVariableValue(variable_name, new_value);
var new_value_mirror = MakeMirror(new_value);
response.body = {
newValue: new_value_mirror
};
};
DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
if (!request.arguments) {
return response.failed('Missing arguments');
......@@ -2663,3 +2737,7 @@ function ValueToProtocolValue_(value, mirror_serializer) {
}
return json;
}
Debug.TestApi = {
CommandProcessorResolveValue: DebugCommandProcessor.resolveValue_
};
......@@ -692,6 +692,11 @@ void OptimizedFrame::Iterate(ObjectVisitor* v) const {
}
void JavaScriptFrame::SetParameterValue(int index, Object* value) const {
Memory::Object_at(GetParameterSlot(index)) = value;
}
bool JavaScriptFrame::IsConstructor() const {
Address fp = caller_fp();
if (has_adapted_arguments()) {
......
......@@ -500,6 +500,9 @@ class JavaScriptFrame: public StandardFrame {
return GetNumberOfIncomingArguments();
}
// Debugger access.
void SetParameterValue(int index, Object* value) const;
// Check if this frame is a constructor frame invoked through 'new'.
bool IsConstructor() const;
......
......@@ -1844,10 +1844,14 @@ function ScopeDetails(frame, fun, index) {
frame.details_.frameId(),
frame.details_.inlinedFrameIndex(),
index);
this.frame_id_ = frame.details_.frameId();
this.inlined_frame_id_ = frame.details_.inlinedFrameIndex();
} else {
this.details_ = %GetFunctionScopeDetails(fun.value(), index);
this.fun_value_ = fun.value();
this.break_id_ = undefined;
}
this.index_ = index;
}
......@@ -1867,6 +1871,22 @@ ScopeDetails.prototype.object = function() {
};
ScopeDetails.prototype.setVariableValueImpl = function(name, new_value) {
var raw_res;
if (!IS_UNDEFINED(this.break_id_)) {
%CheckExecutionState(this.break_id_);
raw_res = %SetScopeVariableValue(this.break_id_, this.frame_id_,
this.inlined_frame_id_, this.index_, name, new_value);
} else {
raw_res = %SetScopeVariableValue(this.fun_value_, null, null, this.index_,
name, new_value);
}
if (!raw_res) {
throw new Error("Failed to set variable value");
}
};
/**
* Mirror object for scope of frame or function. Either frame or function must
* be specified.
......@@ -1914,6 +1934,11 @@ ScopeMirror.prototype.scopeObject = function() {
};
ScopeMirror.prototype.setVariableValue = function(name, new_value) {
this.details_.setVariableValueImpl(name, new_value);
};
/**
* Mirror object for script source.
* @param {Script} script The script object
......
......@@ -10703,6 +10703,87 @@ static Handle<JSObject> MaterializeLocalScope(
}
// Set the context local variable value.
static bool SetContextLocalValue(Isolate* isolate,
Handle<ScopeInfo> scope_info,
Handle<Context> context,
Handle<String> variable_name,
Handle<Object> new_value) {
for (int i = 0; i < scope_info->ContextLocalCount(); i++) {
Handle<String> next_name(scope_info->ContextLocalName(i));
if (variable_name->Equals(*next_name)) {
VariableMode mode;
InitializationFlag init_flag;
int context_index =
scope_info->ContextSlotIndex(*next_name, &mode, &init_flag);
context->set(context_index, *new_value);
return true;
}
}
return false;
}
static bool SetLocalVariableValue(Isolate* isolate,
JavaScriptFrame* frame,
int inlined_jsframe_index,
Handle<String> variable_name,
Handle<Object> new_value) {
if (inlined_jsframe_index != 0 || frame->is_optimized()) {
// Optimized frames are not supported.
return false;
}
Handle<JSFunction> function(JSFunction::cast(frame->function()));
Handle<SharedFunctionInfo> shared(function->shared());
Handle&