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

Commit

Permalink
chakrashim,test: fixes from merge
Browse files Browse the repository at this point in the history
* Add missing tracing API
* Skip new flaky test
* Fix lint issues
  • Loading branch information
kfarnung committed May 22, 2018
1 parent f8f6b8e commit a5e48bf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
2 changes: 2 additions & 0 deletions deps/chakrashim/include/libplatform/v8-tracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class TraceWriter {
virtual void Flush() = 0;

static TraceWriter* CreateJSONTraceWriter(std::ostream& stream);
static TraceWriter* CreateJSONTraceWriter(std::ostream& stream,
const std::string& tag);

private:
// Disallow copy and assign
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/include/v8-inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <cctype>

#include <memory>
#include <vector>

#include "v8.h" // NOLINT(build/include)

Expand Down
22 changes: 14 additions & 8 deletions deps/chakrashim/lib/chakra_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,14 +673,16 @@
return ownPropertyNames;
};

utils.beforeContext = function (contextGlobal) {
utils.beforeContext = function(contextGlobal) {
return Object_getOwnPropertyDescriptors(contextGlobal);
}
};

function descriptorDiff(a, b) {
if (!a || !b) {
return true;
}

// eslint-disable-next-line no-self-compare
if (a.value !== b.value && a.value === a.value && b.value === b.value) {
// allow for NaN in value
return true;
Expand All @@ -695,16 +697,18 @@
}
return false;
}
utils.afterContext = function (beforeDescriptors, contextGlobal, sandbox) {
utils.afterContext = function(beforeDescriptors, contextGlobal, sandbox) {
try {
const afterDescriptors = Object_getOwnPropertyDescriptors(contextGlobal);
const afterDescriptors =
Object_getOwnPropertyDescriptors(contextGlobal);
const beforeKeys = Object_keys(beforeDescriptors);
const afterKeys = Object_keys(afterDescriptors);

for (const beforeKey of beforeKeys) {
const beforeDescriptor = beforeDescriptors[beforeKey];
const afterDescriptor = afterDescriptors[beforeKey];
const sandboxDescriptor = Object_getOwnPropertyDescriptor(sandbox, beforeKey);
const sandboxDescriptor =
Object_getOwnPropertyDescriptor(sandbox, beforeKey);
if (!afterDescriptor) {
// The descriptor was removed
if (sandboxDescriptor) {
Expand All @@ -719,7 +723,8 @@
if (!sandboxDescriptor || sandboxDescriptor.configurable) {
Object_defineProperty(sandbox, beforeKey, afterDescriptor);
} else {
// TODO: How can we handle this case? Node tries to avoid it, but we don't always
// TODO: How can we handle this case? Node tries to avoid it, but
// we don't always
}
}
}
Expand All @@ -731,7 +736,8 @@

// This property is freshly added
const afterDescriptor = afterDescriptors[afterKey];
const sandboxDescriptor = Object_getOwnPropertyDescriptor(sandbox, afterKey);
const sandboxDescriptor =
Object_getOwnPropertyDescriptor(sandbox, afterKey);
if (!sandboxDescriptor || sandboxDescriptor.configurable) {
Object_defineProperty(sandbox, afterKey, afterDescriptor);
} else {
Expand All @@ -741,7 +747,7 @@
} catch (e) {
// ignored;
}
}
};
}

patchErrorTypes();
Expand Down
6 changes: 6 additions & 0 deletions deps/chakrashim/src/v8v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ namespace tracing {
jsrt::Unimplemented("TraceWriter");
return 0;
}

TraceWriter* TraceWriter::CreateJSONTraceWriter(std::ostream&,
const std::string&) {
jsrt::Unimplemented("TraceWriter");
return 0;
}
} // namespace tracing
} // namespace platform
} // namespace v8
4 changes: 2 additions & 2 deletions test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ test-http-pipeline-flood : SKIP
test-http-same-map : SKIP
test-http2-server-rst-stream : SKIP
test-inspect-async-hook-setup-at-inspect : SKIP
test-inspector-multisession-js : SKIP
test-inspector-multisession-ws : SKIP
test-intl : SKIP
test-memory-usage : SKIP
test-module-main-extension-lookup : SKIP
Expand All @@ -68,8 +70,6 @@ test-repl-pretty-stack : SKIP
test-repl-sigint : SKIP
test-repl-tab-complete : SKIP
test-string-decoder : SKIP
test-inspector-multisession-ws : SKIP
test-inspector-multisession-js : SKIP

# ChakraCore does not support the chrome tracing framework
test-trace-events-all : SKIP
Expand Down

0 comments on commit a5e48bf

Please sign in to comment.