-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d0f30a
commit b989891
Showing
5 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
dependencies = [ | ||
"_ESAbstract.CreateHTML", | ||
"_ESAbstract.CreateMethodProperty", | ||
] | ||
spec = "https://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.blink" | ||
docs = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/blink" | ||
|
||
# Browsers which have always supported the feature are commented out. | ||
[browsers] | ||
# android = "*" | ||
bb = "*" | ||
# chrome = "*" | ||
# edge = "*" | ||
# edge_mob = "*" | ||
firefox = "< 4" | ||
# ios_chr = "*" | ||
# ios_saf = "*" | ||
ie = "*" | ||
ie_mob = "*" | ||
# opera = "*" | ||
op_mini = "*" | ||
# op_mob = "*" | ||
# safari = "*" | ||
firefox_mob = "< 4" | ||
# samsung_mob = "*" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'blink' in String.prototype && (function() { | ||
var test = ''.blink('"'); | ||
return test == test.toLowerCase() && test.split('"').length <= 3; | ||
}()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* globals CreateHTML, CreateMethodProperty */ | ||
// B.2.3.4String.prototype.blink ( ) | ||
// When the blink method is called with no arguments, the following steps are taken: | ||
CreateMethodProperty(String.prototype, 'blink', function blink() { | ||
// 1. Let S be the this value. | ||
var S = this; | ||
// 2. Return ? CreateHTML(S, "blink", "", ""). | ||
return CreateHTML(S, "blink", "", ""); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* eslint-env mocha */ | ||
/* globals proclaim */ | ||
|
||
var hasStrictMode = (function () { | ||
return this === null; | ||
}).call(null); | ||
|
||
var ifHasStrictModeIt = hasStrictMode ? it : it.skip; | ||
|
||
it('is a function', function () { | ||
proclaim.isFunction(String.prototype.blink); | ||
}); | ||
|
||
it('has correct arity', function () { | ||
proclaim.arity(String.prototype.blink, 0); | ||
}); | ||
|
||
it('has correct name', function () { | ||
proclaim.hasName(String.prototype.blink, 'blink'); | ||
}); | ||
|
||
it('is not enumerable', function () { | ||
proclaim.isNotEnumerable(String.prototype, 'blink'); | ||
}); | ||
|
||
ifHasStrictModeIt('should throw a TypeError when called with undefined context', function () { | ||
proclaim.throws(function () { | ||
String.prototype.blink.call(undefined); | ||
}, TypeError); | ||
}); | ||
|
||
ifHasStrictModeIt('should throw a TypeError when called with null context', function () { | ||
proclaim.throws(function () { | ||
String.prototype.blink.call(null); | ||
}, TypeError); | ||
}); | ||
|
||
it('works on strings correctly', function() { | ||
proclaim.deepEqual('_'.blink(), '<blink>_</blink>'); | ||
proclaim.deepEqual('<'.blink(), '<blink><</blink>'); | ||
proclaim.deepEqual(String.prototype.blink.call(1234), '<blink>1234</blink>'); | ||
}); |