Skip to content

Instantly share code, notes, and snippets.

View AnnaMag's full-sized avatar

AnnaMag

View GitHub Profile
{ name: 'node',
'dist-tags': { latest: '0.0.0' },
versions: [ '0.0.0' ],
maintainers:
[ { name: 'isaacs',
email: 'i@izs.me' } ],
time:
{ modified: '2015-10-13T00:37:12.824Z',
created: '2012-05-08T21:06:45.400Z',
'0.0.0': '2012-05-08T21:06:46.534Z' },
@AnnaMag
AnnaMag / test-api-interceptors.cc
Created May 22, 2017 13:31
testing v8 interceptors
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdlib.h>
#include "test/cctest/test-api.h"
#include "include/v8-util.h"
#include "src/api.h"

Keybase proof

I hereby claim:

  • I am AnnaMag on github.
  • I am amk (https://keybase.io/amk) on keybase.
  • I have a public key ASAh28c5qJ7vQ3pGAjCGQIDAKlycspwrDWElkXAw6QcQVgo

To claim this, I am signing this object:

@AnnaMag
AnnaMag / .lldbinit
Created January 20, 2017 12:15
helper functions to print V8 Objects
# lldb debugging v8-related functionality in Node.js
# =========================================================
# lldb re-write of user-defined V8 debugging functions
# https://github.com/v8/v8/blob/master/tools/gdbinit
#allow the file to be read when lldb starts (set to false to ignore it)
settings set target.load-cwd-lldbinit true
# Print HeapObjects.
'use strict';
require('../common');
var assert = require('assert');
var vm = require('vm');
var Parent = Object.create(null);
Parent.prototype = {
sProp: 'some string value',
numProp: 2,
@AnnaMag
AnnaMag / test_outvm.js
Created January 14, 2017 17:22
test vm 3
'use strict';
// Refs: https://github.com/nodejs/node/issues/2734
require('../common');
const assert = require('assert');
const vm = require('vm');
const util = require('util');
const sandbox = { globalVar: 1, v: 12 };
Object.defineProperty(sandbox, 'prop', {
@AnnaMag
AnnaMag / test_invm.js
Created January 14, 2017 17:22
vm test 2
'use strict';
require('../common');
var assert = require('assert');
var vm = require('vm');
const util = require('util');
const sandbox = { globalVar: 1 };
const context = vm.createContext(sandbox);
@AnnaMag
AnnaMag / run_lldb_llnode.sh
Created January 12, 2017 22:13
finding Object properties in Node.js JS stack trace
# trying to find 'propBase' attached to the sandbox in test-vm-inherited_properties.js
# breakpoint set at CopyProperties
# inspecting the Object created at:
# frame #21: 0x00003bb3887f4dc5 Script.runInContext(this=0x000024c114b2b5a9:<Object: ContextifyScript>, 0x00001237d6e845f1:<Object: Object>, 0x00001b78a4782241:<undefined>) at vm.js:30:41 fn=0x0000334f80adda39
# Obviously Id's are run-specific;)
lldb -- ./node --perf-basic-prof test/known_issues/test-vm-inherited_properties.js
@AnnaMag
AnnaMag / test-vm-accessor-props.js
Created December 28, 2016 21:25
Test for changes in the Node.js's Copy Properties (accessor property check)
'use strict';
require('../common');
const vm = require('vm');
const assert = require('assert');
var x = { value : 13};
Object.defineProperty(x, 'p0', {value : 12});
Object.defineProperty(x, 'p1', {
set : function(value) { this.value = value; },
get : function() { return this.value; },
@AnnaMag
AnnaMag / helpers.cc
Last active July 15, 2019 05:59
Helper functions for printing V8 Local-wrapped objects
#include "v8.h"
#include "helpers.h"
#include <iostream>
using v8::Local;
using v8::String;
using v8::Array;
void PrintLocalString(v8::Local<v8::String> key){