docs/libs/typescript.js
function cloneNode(node, location, flags, parent) {
        // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of
        // the original node. We also need to exclude specific properties and only include own-
        // properties (to skip members already defined on the shared prototype).
        var clone = location !== undefined
            ? ts.createNode(node.kind, location.pos, location.end)
            : createSynthesizedNode(node.kind);
        for (var key in node) {
            if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) {
                continue;
            }
            clone[key] = node[key];
        }
        if (flags !== undefined) {
            clone.flags = flags;
        }
        if (parent !== undefined) {
            clone.parent = parent;
        }
        return clone;
    }
function cloneNode(node, location, flags, parent) {
        // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of
        // the original node. We also need to exclude specific properties and only include own-
        // properties (to skip members already defined on the shared prototype).
        var clone = location !== undefined
            ? ts.createNode(node.kind, location.pos, location.end)
            : createSynthesizedNode(node.kind);
        for (var key in node) {
            if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) {
                continue;
            }
            clone[key] = node[key];
        }
        if (flags !== undefined) {
            clone.flags = flags;
        }
        if (parent !== undefined) {
            clone.parent = parent;
        }
        return clone;
    }
function cloneNode ( node , location , flags , parent ) { // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared prototype). var clone = location !== undefined ? ts . createNode ( node . kind , location . pos , location . end ) : createSynthesizedNode ( node . kind ) ; for ( var key in node ) { if ( clone . hasOwnProperty ( key ) || ! node . hasOwnProperty ( key ) ) { continue ; } clone [ key ] = node [ key ] ; } if ( flags !== undefined ) { clone . flags = flags ; } if ( parent !== undefined ) { clone . parent = parent ; } return clone ; }
Creates a shallow, memberwise clone of a node. The "kind", "pos", "end", "flags", and "parent"
properties are excluded by default, and can be provided via the "location", "flags", and
"parent" parameters.
@param node The node to clone.
@param location An optional TextRange to use to supply the new position.
@param flags The NodeFlags to use for the cloned node.
@param parent The parent for the new node.
Creates a shallow memberwise clone of a node . The kind pos end flags and parent properties are excluded by default and can be provided via the location flags and parent parameters .