// Description | |
// さすおに | |
// http://mahouka.jp/special/#s07 | |
// | |
// Configuration: | |
// None | |
// | |
// Commands: | |
var help = function () { | |
var text = |
- 特に何も無い
- 依存するモジュールの関数を引きずり出しているだけ
virtual-dom/h
は例外で、与えた引数からVNodeを作る為のラッパー
"use strict"; | |
// MIT License | |
// author: Tetsuharu OHZEKI | |
/* | |
* Parse from HTML text to DOM subtree which does not have scripting items. | |
* | |
* @param {string} aText | |
* @return {DocumentFragment} |
The following part will be added to https://github.com/mozilla/servo/wiki/Garbage-collected-DOM
——————————
For supporting SpiderMonkey’s exact GC’s rooting, we introduce some types:
JS<T>
is used for the DOM typed field in a DOM type structure. GC can trace them recursively while enclosing DOM object (maybe root) is alive.Temporary<T>
will used as a return value of functions returning DOM type. They are rooted while they are alive. But a retun value gets moved around. It’s breakable for the LIFO ordering constraint. Thus we need introduceRoot<T>
.Root
containsJSObject
which the represented DOM type has. SpiderMonkey's conservative stack scanner will scan itsJSObject
and mark it as GC root.
<html> | |
<head> | |
<title>starting title</title> | |
</head> | |
<body> | |
<script> | |
var element = document.createElement("div"); | |
// setup | |
for (var i = 0; i < 1000; ++i) { | |
var val = String( Math.random() ); |
"use strict"; | |
var TrieTree = function () { | |
this._root = new TrieNode(undefined); | |
Object.freeze(this); | |
}; | |
TrieTree.prototype = Object.freeze({ | |
/* |
function fetchingXHR() { | |
var xhr = new XMLHttpRequest(); | |
var rejection = null; | |
var fetching = new Promise((resolve, reject) => { | |
rejection = reject; | |
xhr.open("GET", "http://example.com", true); | |
xhr.onload = function () { | |
resolve(xhr.responseText); |
I’ll add the bellow section to https://github.com/mozilla/servo/wiki/JS-smart-pointers.
——————————————————————————————
When Servo creates a Rusty DOM object, the binding code creates a wrapper JSObject
which is created by SpiderMonkey, is correspond to each Rusty DOM Object. It’s produced and set to the Rusty object in FooBinding::Wrap
.
In FooBinding::Wrap
, the warpper JSObject gets the pointer for Rusty Object to itself. And the same time, the wrapper JSObject
are set to the Rusty Object’s Reflector
field (All Rusty DOM objects have dom::bindings::utils::Reflector
in their most basis field). These step are the “binding” work to create the relationship of both objects.
/* vim: set filetype=javascript shiftwidth=4 tabstop=4 expandtab: */ | |
/* | |
* @repository https://github.com/saneyuki/observer-js | |
* @version 0.4 | |
* @license MIT License | |
*/ | |
/* | |
* Copyright (c) 2014 Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy |