Created
April 28, 2015 23:29
-
-
Save Constellation/8dee9b7ba8cffb492ca8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| unsigned start = 0; | |
| if (value.isUInt32()) | |
| start = value.asUInt32(); | |
| else { | |
| double valueAsNumber = value.toInteger(exec); | |
| if (exec->hadException()) | |
| return jsUndefined(); | |
| if (valueAsNumber < 0) | |
| start = 0; | |
| else { | |
| if (valueAsNumber > length) | |
| start = length; | |
| else | |
| start = static_cast<unsigned>(valueAsNumber); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment