Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
33 lines (30 loc) · 1 KB

File metadata and controls

33 lines (30 loc) · 1 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
// Testing our implementation of the substring, making sure that we keep the correct reference
// of the original string so that it doesn't get collected
var s = new String();
s = s + 'a';
s = s + 'b';
s = s + 'c';
s = s + 'd';
s = s + 'e';
var s1 = s.substr(1,3);
var s2 = s1.substr(1,2);
s = undefined;
s1 = undefined;
//implicit calls
function foo()
{
var a = 1;
var b = 2;
var obj = {toString: function(){ a=3; return "Hello World";}};
a = b;
Object.prototype.substring = String.prototype.substring;
var f = obj.substring(2,7);
WScript.Echo (a);
}
foo();
CollectGarbage();
WScript.Echo(s2);
Morty Proxy This is a proxified and sanitized view of the page, visit original site.