Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: fix undefined values in inspector
Browse files Browse the repository at this point in the history
When creating the wrapped objects we were copying the `undefined`
properties which were then being translated to `null` during
serialization.

Fixes #280

PR-URL: #284
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
  • Loading branch information
kfarnung committed Jun 5, 2017
1 parent 7528ca6 commit d8ef944
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deps/chakrashim/src/jsrtinspectorhelpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "v8chakra.h"
#include "jsrtinspectorhelpers.h"
#include "jsrtutils.h"

namespace jsrt {
static const int JsrtDebugPropertyAttributeReadOnly = 4;
Expand Down Expand Up @@ -59,6 +60,13 @@ namespace jsrt {
JsValueRef sourceVal = nullptr;
IfJsErrorRet(JsGetProperty(sourceObj, propId, &sourceVal));

bool isUndefined;
IfJsErrorRet(jsrt::IsUndefined(sourceVal, &isUndefined));

if (isUndefined) {
return JsNoError;
}

JsValueRef destVal = nullptr;
if (convertFunc != nullptr) {
IfJsErrorRet(convertFunc(sourceVal, &destVal));
Expand Down

0 comments on commit d8ef944

Please sign in to comment.