diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 65235e105..29da1c542 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -2220,6 +2220,13 @@ function test_prop() { var title: string = $('option:selected', this).prop('title'); } + +function test_selector() { + var $main = $('#main'); + var $mainDivs = $('div', $main); + return $mainDivs.selector == '#main div'; +} + function test_text() { var str = $("p:first").text(); $("p:last").html(str); diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index cdae1d8ec..4d650c98f 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -700,6 +700,7 @@ interface JQuery { PROPERTIES ***********/ length: number; + selector: string; [x: string]: HTMLElement; [x: number]: HTMLElement; diff --git a/mustache/mustache-tests.ts b/mustache/mustache-tests.ts index 744e85585..9b42131ef 100644 --- a/mustache/mustache-tests.ts +++ b/mustache/mustache-tests.ts @@ -5,4 +5,7 @@ var output = Mustache.render("{{title}} spends {{calc}}", view); var person; var template = "

{{firstName}} {{lastName}}

Blog: {{blogURL}}"; -var html = Mustache.to_html(template, person); \ No newline at end of file +var html = Mustache.to_html(template, person); + +var writer = Mustache.compile(template); +var writerOutput = writer(view); diff --git a/mustache/mustache.d.ts b/mustache/mustache.d.ts index 1bc1a6cdd..c1be75afd 100644 --- a/mustache/mustache.d.ts +++ b/mustache/mustache.d.ts @@ -24,6 +24,7 @@ interface MustacheContext { } interface MustacheWriter { + (view: any): string; clearCache(); compile(template: string, tags); compilePartial(name, template, tags); @@ -42,6 +43,7 @@ interface MustacheStatic { parse(template: string, tags); clearCache(): MustacheWriter; + compile(template: string): MustacheWriter; compile(template: string, tags): MustacheWriter; compilePartial(name: string, template: string, tags): MustacheWriter; compileTokens(tokens, template: string): MustacheWriter;